Check for spamming

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
paen08
Posts: 9
Joined: Thu Dec 24, 2020 6:31 am

Check for spamming

Post by paen08 »

Hello!

Is it possible to set up an alert in Nagios Log Server if we send for example more than 2 messages in 12 hours to a specific number?

20-01-2021 22:27:54.700|iCamp-03|3|300e92900f09ca6|6|S|2||U|MesgSent|Dispatched to SMSC|31154|Message_Name|1000|20-01-2021 22:27:52.374|4512345678|238201234567890|||491234567890||491234567890|4587654321||false|262|01|97|238|20|56|Velkommen til Tyskland. Dit abonnement kan bruges på samme vilkår som i Danmark. Du kan bruge op til 14 GB af dit inkluderede data i EU, alt efter hvor meget EU data du har inkluderet i dit abonnement. Herefter er prisen 0,02 kr./MB indtil du når din nationale datamængde hvorefter prisen er 0,80 kr./MB. Priser udover hvad der er inkluderet i dit abonnement: - Afsendelse af sms 0,07 kr./stk. - Afsendelse af mms koster 0,37 kr./ stk. Alle priser er ekskl. moms. Tjek dit EU data forbrug ved at sende SMS med ”forbrug” til 81111. Har du brug for at kontakte os, kan du ringe på +45 28270005. Venlig hilsen Telia||||||CA66885B665BEB61949601000100DC74|smsc2|DK||371|43|351|45|0|0|1|0|0|56|97|351|371|442#0|T|1|0

Best regards
/Patrik
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Check for spamming

Post by cdienger »

NLS could detect if the string 'Dispatched to SMSC' was seen in logs at a specific frequency, but it may get a little tricky if you're trying to do this per number. I assume 4512345678 is an example of a number - does this number change? Do you have a complete list of possible numbers? Without looking for specific numbers I don't believe what you want can be achieved in NLS.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
paen08
Posts: 9
Joined: Thu Dec 24, 2020 6:31 am

Re: Check for spamming

Post by paen08 »

Yes, exactly. This number 4512345678 is an example of a phone-number, and the objective is to check if many messages ('Dispatched to SMSC') are sent to this phone-number within a time-frame. Phone-numbers can be many and no real list exist per se.

Is that achievable?

Best regards
/Patrik
scv831
Posts: 12
Joined: Thu Dec 24, 2020 6:38 am

Re: Check for spamming

Post by scv831 »

Hi, Is it possible to split this message in different columns ?

I know that grok can be used. But can you help with grok filter definition for 10-15 fields for below text ?

20-01-2021 22:27:54.700|iCamp-03|3|300e92900f09ca6|6|S|2||U|MesgSent|Dispatched to SMSC|31154|Message_Name|1000|20-01-2021 22:27:52.374|4512345678|238201234567890|||491234567890||491234567890|4587654321||false|262|01|97|238|20|56|Velkommen til Tyskland. Dit abonnement kan bruges på samme vilkår som i Danmark. Du kan bruge op til 14 GB af dit inkluderede data i EU, alt efter hvor meget EU data du har inkluderet i dit abonnement. Herefter er prisen 0,02 kr./MB indtil du når din nationale datamængde hvorefter prisen er 0,80 kr./MB. Priser udover hvad der er inkluderet i dit abonnement: - Afsendelse af sms 0,07 kr./stk. - Afsendelse af mms koster 0,37 kr./ stk. Alle priser er ekskl. moms. Tjek dit EU data forbrug ved at sende SMS med ”forbrug” til 81111. Har du brug for at kontakte os, kan du ringe på +45 28270005. Venlig hilsen Telia||||||CA66885B665BEB61949601000100DC74|smsc2|DK||371|43|351|45|0|0|1|0|0|56|97|351|371|442#0|T|1|0
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Check for spamming

Post by cdienger »

@scv831:
Hi, Is it possible to split this message in different columns ?
Yes, I'd recommend checking out https://assets.nagios.com/downloads/nag ... ilters.pdf to see how to apply filters. And to provide an example of a grok filter parsing the first few columns I'll provide:

Code: Select all

grok {
        date {
            match => [ 'message', '%{DATE:date} %{TIME:time}\|%{DATA:test}\|%{INT:int}\|%{DATA:string}\|%{INT:int2}\|%{DATA:string2}\|%{INT:int3}%{GREEDYDATA:therestofit}' ]
        }
}
@paen08:
Is that achievable?
Unfortunately not with a dynamic number.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked