Right now, I have a watch set up to send errors within a set window to a hipchat webhook. Unfortunately, it is only sending the most recent error. I would like to send all unique errors in that window but unsure how. The following is my current curl comman:
To confirm your goal - do you you want one hipchat message that contains all the hosts that had errors, or do you want to send one message per host?
The first one (one message listing multiple hosts) should be possible today, using mustache templates over the results array. So in your message body, you could do something like:
To verify, I need to show every unique message the comes through in my time frame. For example, the watch runs at 2:05 and shows 3 error messages that were logged to apache error_log between 2:00-2:05. Right now, it only shows the most recent log entry.
IMO, you're going to want to iterate over the hits, so each one gets added to the message:
"body": "New error seen in api apache error_log! {{#ctx.payload.hits.hits}} \n\nHost: {{_source.beat.hostname}}\nMessage: {{_source.message}} {{/ctx.payload.hits.hits}}"
It is actually outputting hits on a schedule without any new error. Looks blank because there wasn't an error in the timeframe. Still no cooperating as expected.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.