I
I
Ivan2018-11-13 16:32:52
linux
Ivan, 2018-11-13 16:32:52

How to remove duplicate messages?

There is a syslog server with a python parser. Repetitive events can fly in too often. How to filter them correctly so as not to send everything that arrived in slack?
log example

16:13:53+03:00 1.8.8.8 Action="accept"  inzone="World" outzone="local" rule="7" service_id="http" src="1.17.239.63" dst="1.9.15.20" proto="6" dst_machine_name="btp-galera01"  service="443" s_port="65113"
16:14:53+03:00 1.8.8.8 Action="accept"  inzone="local" outzone="World" rule="8" service_id="http" src="1.9.15.20" dst="1.17.239.63" proto="6" dst_machine_name="sqr_cl-01-eu"  service="443" s_port="65180"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pfg21, 2018-11-13
@pfg21

write a script - collect a hash of lines without timestamps, if the hash repeats -
drop a line. Drop hash records every minute.
programs specifically for your conditions may not be.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question