Skip to content

Instantly share code, notes, and snippets.

@oscarandreu
Last active August 3, 2018 08:20
Show Gist options
  • Save oscarandreu/ccf08135509ef063db2da4e8859e9400 to your computer and use it in GitHub Desktop.
Save oscarandreu/ccf08135509ef063db2da4e8859e9400 to your computer and use it in GitHub Desktop.
Telegraf configuration to parse NiFi logs (nifi-app)
NIFI_TASK \[%{GREEDYDATA:NifiTask} %{NOTSPACE:Thread}\]
[[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:tag} %{NIFI_TASK:NifiTask} %{NOTSPACE:NifiEventType} %{GREEDYDATA:EventText} %{NUMBER:EventDuration} %{WORD:EventDurationUnits}"]
grok_custom_pattern_files = ["/etc/telegraf/brackets_pattern"]
# NIFI_TASK \[%{GREEDYDATA:NifiTask} %{NOTSPACE:Thread}\]
[[outputs.file]]
files = ["stdout"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment