title: Tagging the Logs by Logstash - Grok - ElasticSearch
body: <p>Summary:</p>
  
  <p>I am using Logstash - Grok and elastic search and my main aim is to First accept the logs by logstash, parse them by grok and associate tags with the messages depending on the type of the log, and then finally feed it to the Elastic server to query with Kibana.</p>
  
  <p>I have already written this code but am not able to get the tags in Elastic Search.
  This is my logstash confif file.</p>
  
  <pre><code>input {
    stdin {
      type =&gt; "stdin-type"
    }
  }
  filter {
    grok {
      tags    =&gt; "mytags"
      pattern =&gt; "I am a %{USERNAME}"
      add_tag =&gt; "mytag"
      named_captures_only =&gt; true
    }
  }
  output {
    stdout { debug =&gt; true debug_format =&gt; "json"}
    elasticsearch {}
  }
  </code></pre>
  
  <p>Where am I going wrong?</p>