I am trying to create a watch which should alert our Team only when a certain condition matches,
For example: "whenever a Failed Login Attempt Detected"
RightNow it is sending me an email after each 1 hour with same ctx.paylod.hits.total as no failed login is made and /var/log/secure file has no updates, same time my index which is carrying out /var/log/secure logs is the same as I stopped trying failed attempts, but watcher still sending because it has a scheduled trigger of 1 hr. how can I make it trigger only when a certain condition matches like whenever someone tries to do login and gets failed then only it should send me an email, or whenever index gets updated then only I should get an update by email
The watch will trigger once every hour, but you do not seem to have a range condition in your query to only search logs that came in the last X hours. The query therefore looks at ALL data, which might be why you are seeing an email being generated every time.
i am not able to understand you. can you write a sample for my query,
i think i need to write compare condition when current count of "ctx.payload.hits.total" is gte than
Last "ctx.payload.hits.total" but dont know how to compare two "ctx.payload.hits.total" current one and last one.
This will prevent you from looking at ALL documents in the index every time, as only the documents with a @timestamp within the last hour are considered.
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.