Questions tagged [elasticsearch-watcher]

Watcher is a plugin for Elasticsearch that provides alerting and notification based on changes in your data.

Watcher installs in Elasticsearch as a plugin and provides an API for creating, managing and testing watches. A watch describes a single alert in Watcher, which can contain multiple notification actions.

At a high-level, a typical watch is built from four simple building blocks:

  • schedule

Define the schedule on which to trigger the query and check the condition.

  • Query

Specify the query to run as input to the condition. Watcher supports the full Elasticsearch query language, including aggregations.

  • Condition

Define your condition to determine whether to execute the actions. You can use simple conditions (always true), or use scripting for more sophisticated scenarios.

  • Actions

Define one or more actions, such as sending email, pushing data to 3rd party systems via webhook, or indexing the results of your query.

For more details: https://www.elastic.co/guide/en/watcher/current/index.html

73 questions
3
votes
2 answers

Elasticsearch watcher and Microsoft Teams webhook

I have been trying desperately for 5 days to create an elasticsearch watcher alert that sends a notification on an incoming webhook teams. However, the answer I receive is "Bad payload received by generic incoming webhook". I do not understand why…
3
votes
1 answer

Throttle Elasticsearch Watcher to one alert

How do I throttle an Elasticsearch Watcher to one alert per event. If an error shows in the logs the watcher will fire until it's acknowledged. I only want alerts for new errors not a time throttle.
3
votes
2 answers

Cannot Transform Correctly with Elasticsearch Watcher {{ctx.payload.hits.hits}}

I have a watcher configuration as follows: { "trigger": { "schedule": { "interval": "5s" } }, "input" : { "search" : { "request" : { "indices" : [ "my_index" ], "types" : [ "my_type" ], "body" :…
3
votes
1 answer

Elasticsearch watcher email array value

I am working on ELK watcher to create an alert that sends an array of value transformed using 'transform' mapping. "transform": { "script": "return [ err_yest : ctx.payload.aggregations.errorcount.buckets.collect { [err_count:it.doc_count,…
svjn
  • 904
  • 2
  • 19
  • 35
2
votes
1 answer

Create kibana watcher to trigger email with containg kibana json attribute value

We have multiple applications which pushing log into Kibana. In JSON, below parameter will be there : srcSystem.componentName: "DATA-LAMBDA-FUNCTION" srcSystem.data.auditJson.job_status: "FAILURE" srcSystem.data.auditJson.errorMessage: "Bad SQL…
MKumar
  • 79
  • 2
  • 6
2
votes
0 answers

How to use wildcard in elastalert rules

I need help in ELASTALERT I have a log message like this : log.info("Server is started at "+LocalDateTime.now()); and I need to write a query in rule for it: I am writing as - query: query_string: query: "message: *Server is*" It…
user14748001
2
votes
1 answer

How do you get a single value and run conditional check in elasticsearch query syntax for percentages using sentinl plugin

I'm using Elasticsearch 6.4 and Kibana 6. Also I am using the Sentinl plugin. https://github.com/sirensolutions/sentinl This plugin is a free alternative to xpact watchers and monitoring. I'm having some difficulty writing the watcher queries…
2
votes
1 answer

Problems accessing _source fields with a dot in the name when creating Slack action for Elasticsearch Watcher

I am trying to create a Slack action with a dynamic attachment. My _source looks like this: { "user.url": "https://api.github.com/users/...", "user.gists_url": "https://api.github.com/users/.../gists{/gist_id}", "user.repos_url":…
Caleb Keller
  • 2,151
  • 17
  • 26
2
votes
0 answers

searchSource not found (Elasticsearch-Watcher JAVA API)

I am trying to create a new watcher using PUTWatch API of JAVA ElasticSearch. I am following this to create it. From that link: SearchRequest request = Requests.searchRequest("idx").source(searchSource() …
Priyansh Goel
  • 2,660
  • 1
  • 13
  • 37
1
vote
1 answer

How to pass result of one chained input, into next chained input

I am writing a watcher, to first fetch destination.ip field (using aggregation), and then I have to use 1st input result for terms query value (in 3rd input) POST _watcher/watch/_execute { "watch": { "trigger": { "schedule": { …
ESCoder
  • 15,431
  • 2
  • 19
  • 42
1
vote
0 answers

ElasticSearch Watcher simulate fires the action, otherwise it's stuck

I have a slack action configured. All aspects appear to be set up correctly. If I go to my watch's simulate section and choose execute (not ignoring the conditions) it executes fine and the message appears correctly templated in slack. If I save the…
Brandon Kauffman
  • 1,515
  • 1
  • 7
  • 33
1
vote
1 answer

how to send email alert to groups based on condition success in kibana watcher action

I am able to categorize various error like this --- But i want to send email to groups based on error message. Something like --- when error ie "key"= "Response status code does not indicate success Service Unavailable" ---send email to group 1…
1
vote
0 answers

Elastic Search Watcher : handle redundant docs

I have a watcher that runs every 5 sec and get records of last 6 sec. So, there are cases in which i get the docs in the hit which were also present in previous hits. How can I resolve this redundancy? Thank you.
1
vote
0 answers

Why is watcher giving errors?

I want to send slack notifications to a channel as soon as any log with loglevel ERROR appears in my index. I have configured watcher in the following way but it is giving me errors. The slack message must have the log message. I am not able to…
1
vote
1 answer

How to use Elastic Search to get alerts when document's datetime field value is 2 days

percolate can be run when there is any updates on the document and we can identify any rules matching the document. But how can we use this to find documents where a datetime field value is 2 days away, like, find open tickets and 2 days before…
1
2 3 4 5