elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

Add a count option

Open Alexwii opened this issue 9 years ago • 3 comments

Hello !

I have an idea for a next update, add an option who can count how many of the same message type.

I explain: When a Cisco syslog with "Interface GigabitEthernet0/9, changed state to up" arrived, Elastalert count how many the same message and may be added on the summary table.

Alexwii avatar May 18 '17 11:05 Alexwii

+1

Trustys avatar May 18 '17 13:05 Trustys

Doesn't the summary table already do this? If matches are

{"message:" "Interface GigabitEthernet0/9, changed state to up", "@timestamp": "2017..."}
{"message:" "Interface GigabitEthernet0/8, changed state to up", "@timestamp": "2017..."}
{"message:" "Interface GigabitEthernet0/9, changed state to up", "@timestamp": "2017..."}
{"message:" "Interface GigabitEthernet0/9, changed state to up", "@timestamp": "2017..."}
{"message:" "Interface GigabitEthernet0/8, changed state to down", "@timestamp": "2017..."}

and you have

summary_table_fields: ['message']

it will output something like

+-----------------------------------------------------+-------+
|                       message                       | count |
+=====================================================+=======+
| Interface GigabitEthernet0/9, changed state to up   | 3     |
+-----------------------------------------------------+-------+
| Interface GigabitEthernet0/8, changed state to down | 1     |
+-----------------------------------------------------+-------+
| Interface GigabitEthernet0/8, changed state to up   | 1     |
+-----------------------------------------------------+-------+

Qmando avatar May 18 '17 18:05 Qmando

You can do something similar with top_count_keys too.

Qmando avatar May 18 '17 18:05 Qmando