Getting Data In

How do you collect log within 1 hour from file log rotate?

hiepdv4
New Member

Dear all,

I have file log access /var/log/secure .
Use log rotate ( setting daily)
I need collect log login fail 3 times on 1 IP within 1 hour from file log /var/log/secure.
I used the following query:

> source="/var/log/secure" sourcetype=linux_secure process=sshd "password for" NOT pam_unix NOT Accepted earliest=-24h latest=now | rex field=_raw "(?Accepted|Failed) password for (?\w+) from (?[0-9A-Fa-f:\.]+)" | stats count by ipaddr | where count >=3

I need support collecting logs with 1 hours
Please support me.

Tags (2)
0 Karma
1 Solution

sudosplunk
Motivator

Use timechart instead of stats, ...| timechart span=1h count by ipaddr | where count>2

OR

Use bin command, index=index source=source | bin _time span=1h |...rest of the search...|stats count by ipaddr | where count >2

View solution in original post

0 Karma

sudosplunk
Motivator

Use timechart instead of stats, ...| timechart span=1h count by ipaddr | where count>2

OR

Use bin command, index=index source=source | bin _time span=1h |...rest of the search...|stats count by ipaddr | where count >2

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...