title: LogBack - LogStash - Add properties in the logback and send them to Logstash
body: <p>I'm using Logback and Logstash in a SpringBoot application.</p>
  
  <p>In the logback.xml I have a property with the name of the service, and is like:</p>
  
  <pre><code>&lt;configuration&gt;
  
  &lt;include resource="org/springframework/boot/logging/logback/defaults.xml" /&gt;
  
  &lt;include resource="org/springframework/boot/logging/logback/console-appender.xml" /&gt;
  
  &lt;property name="spring.application.name" calue="service"/&gt;
  
  &lt;appender name="stash" class="net.logstash.logback.appender.LogstashTcpSocketAppender"&gt;
      &lt;destination&gt;localhost:9600&lt;/destination&gt;
      &lt;encoder class="net.logstash.logback.encoder.LogstashEncoder"/&gt;
  &lt;/appender&gt;
  
  &lt;root level="INFO"&gt;
      &lt;appender-ref ref="CONSOLE" /&gt;
      &lt;appender-ref ref="stash" /&gt;
  &lt;/root&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The Logstash conf file is like:</p>
  
  <pre><code>input{ tcp{
          port=&gt; 9600
          host=&gt;logstash
      }
  }
  
  filter {
  grok {
  match =&gt; {
    "message" =&gt;
    "^%{TIMESTAMP_ISO8601:timestamp}\s+%{LOGLEVEL:level}\s+%{NUMBER:pid}\s+---\s+\[\s*%{USERNAME:thread}\s*\]\s+%{JAVAFILE:class}\s*:\s*%{DATA:themessage}(?:\n+(?&lt;stacktrace&gt;(?:.|\r|\n)+))?$"
  }
  }
  date {
  match =&gt; [ "timestamp" , "yyyy-MM-dd HH:mm:ss.SSS" ]
  }
   mutate {
  remove_field =&gt; ["@version"]
  add_field =&gt; {
    "appid" =&gt; "%{[path]}"
  }
  add_field =&gt; {
    "levell" =&gt; "level"
  }
  add_field =&gt; {
    "mensage" =&gt; "message"
  }
   }
     }
  output{
  
   elasticsearch {
  hosts =&gt; ["elasticsearch"]
  index =&gt; "indice"
   }
     stdout{}
   } 
  </code></pre>
  
  <p>How can I do to add the property of application name from the logback file as a field?</p>