title: Telegraf tail with grok pattern error
body: <p>I am using Telegraf to get logs information from Apache NiFi, for this task I am using this config:</p>
  
  <pre><code>[[inputs.tail]]
    ## files to tail.
    files = ["/var/log/nifi/nifi-app.log"]
    ## Read file from beginning.
    from_beginning = true
    #name_override = "nifi_app"
  
    ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
    data_format = "grok"
    grok_patterns = [ "%{DATE:date} %{TIME:time} %{WORD:EventType} \[%{GREEDYDATA:NifiTask} %{NOTSPACE:Thread}\] %{NOTSPACE:NifiEventType} %{GREEDYDATA:EventText} %{NUMBER:EventDuration} %{WORD:EventDurationUnits}" ]
  </code></pre>
  
  <p>When I try to start telegraf it give me this error:  </p>
  
  <blockquote>
    <p>Error parsing /etc/telegraf/telegraf.conf, toml: line 10: parse error  </p>
  </blockquote>
  
  <p>The pattern I wrote was tested in a <a href="https://grokdebug.herokuapp.com/" rel="nofollow noreferrer">Grok debugger</a> with this text:  </p>
  
  <blockquote>
    <p>2018-08-02 10:53:16,976 INFO [Heartbeat Monitor Thread-1]
    o.a.n.c.c.h.AbstractHeartbeatMonitor Finished processing 1 heartbeats
    in 11863 nanos</p>
  </blockquote>
  
  <p>These are the results of some testing:</p>
  
  <pre><code>grok_patterns = ["\[%{GREEDYDATA:NifiTask}\]"] ==&gt; toml: line 10: parse error  
  grok_patterns = ["[%{GREEDYDATA:NifiTask}]"] ==&gt; Invalid data format: grok  
  grok_patterns = ['\[%{GREEDYDATA:NifiTask}\]'] ==&gt; Invalid data format: grok  
  grok_patterns = ["\\[%{GREEDYDATA:NifiTask}\\]"] ==&gt; Invalid data format: grok  
  grok_patterns = ['[%{GREEDYDATA:NifiTask}]'] -&gt; Invalid data format: grok  
  </code></pre>
  
  <p>The first option for me is the right one, but doesn't works, and the problem seems to be the way the bracket is being escaped.</p>
  
  <p>How is possible to solve this issue?</p>