Splunk Search

How to write a search to track system time change in a Linux system?

vkumar6
Explorer

I need an example search to track system time change in a Linux system. Please help me.

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi vkumar6.
The way to find if a server system time has changed is to take logs from /var/log/messages and create a search like this:

index=your_index source="/var/log/messages" “Time has been changed” | ...

before to do this you have to be sure that system time changes are correctly logged, if not you have to add following to the audit.rules file. Should record any attempt to set or adjust time from on—privileged user or root:

-S clock_settime –S settimeofday –S adjtimex

Bye.
Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi vkumar6.
The way to find if a server system time has changed is to take logs from /var/log/messages and create a search like this:

index=your_index source="/var/log/messages" “Time has been changed” | ...

before to do this you have to be sure that system time changes are correctly logged, if not you have to add following to the audit.rules file. Should record any attempt to set or adjust time from on—privileged user or root:

-S clock_settime –S settimeofday –S adjtimex

Bye.
Giuseppe

vkumar6
Explorer

Thank you ... 🙂 Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi vkumar6.
if the solution solves your needs, please accept my answer.
By.
Giuseppe

0 Karma

vkumar6
Explorer

Hi Giuseppe,

Is there any event code for linux when system time changes. Like windows we have Event code 4616 in the same do we have any event code for linux

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi vkumar6,
No, for my knoledge there aren't eventcodes in Linux but the message “Time has been changed” in "/var/log/messages" it's sufficient to trap this event.
Bye.
Giuseppe

0 Karma

vkumar6
Explorer

Hi Giuseppe,

Thnakyou so much i m able to get logs .

Thanks,
Vijay

0 Karma

gcusello
SplunkTrust
SplunkTrust

modify your inputs.conf to take also "/var/log/messages".
Bye.
Giuseppe

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Would you please be more specific about what you are trying to do?

---
If this reply helps you, Karma would be appreciated.
0 Karma

vkumar6
Explorer

Thankyou Rich I got answer from Giuseppe..

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...