npm install emitterly --global
events:
# This is a event name
# It has a file that it watches and grok patterns that
# Will match the last line that has been observed
newlineevent:
# The file to watch
file: './test.txt'
# There can be multiple filters
filters:
# this filter called filter1 will match: [12:08:44] 192.168.2.1 (INFO) - User logged in
filter1: '\[%{TIME:time}\] %{IP:ip} \(%{WORD:type}\) - %{GREEDYDATA:message}'
# There can be multiple actions
actions:
# A webhook action only needs a url to post to, it will post in JSON format
webhook: 'https://webhook.site/04ed7a87-f9e5-472d-8f66-fc50f83b0a67'
# The condition for the actions to be triggered in this event, you can use variables from the event class itself
# For example: '"%match.ip%" == "192.168.2.1"'
condition: '1 === 1'
# The payload to send with the actions
payload:
data: '%match.ip% %event% %condition% customstring'
emitterly --config "/path/to/your/settings.yml"
That's it your all done! Emitterly will listen for file changes and trigger your actions
Emitterly uses grok filters to extract key value pairs from a line event