elastalert
elastalert copied to clipboard
Add a count option
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.
+1
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 |
+-----------------------------------------------------+-------+
You can do something similar with top_count_keys too.