How to check sum of unique events in watcher & list those unique events in output action using wathers

alerting

(Yash M.) #1

Hello Folks,

I recently started working on watcher. I have certain condition which i want to check in one watcher step wise step and then it will push those condition result in output action.

  1. how to check sum of unique events regarding another field of same index.
  2. How to list all unique events regarding another field of same index.

Can anyone suggest how can i test such activity on watchers.

Bests,
Yash


(Alexander Reelsen) #2

the requirements are a bit blurry, so I'll try to talk about your possible options

First, you could try to write proper search queries that count for unique fields using the cardinality aggregation. This way everything gets done on the search side and you dont need to do any postprocessing

Second, you could implement this functionality in your own condition or transformation by using a set, but this is rather memory intensive and thus should only be done for smaller datasets.

--Alex


(Yash M.) #3

Do you have any sample watcher json to simulate similar scenario ?


(Alexander Reelsen) #4

Nothing that concrete. I recommend you to take a look at our examples repository however, which contains a fair share of sample watches.


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.