Alerting

How to find when index was last updated

sivakumar28
Loves-to-Learn

Hi All,

 

I have this query that runs 

| tstats latest(_time) as LatestEvent where index=* by index, host
| eval LatestLog=strftime(LatestEvent,"%a %m/%d/%Y %H:%M:%S")
| eval duration = now() - LatestEvent
| eval timediff = tostring(duration, "duration")
| lookup HostTreshold host
| where duration > threshold
| rename host as "src_host", index as "idx"
| fields - LatestEvent
| search NOT (index="cim_modactions" OR index="risk" OR index="audit_summary" OR index="threat_activity" OR index="endpoint_summary" OR index="summary" OR index="main" OR index="notable" OR index="notable_summary" OR index="mandiant")

 

The result is below

sivakumar28_0-1699609144424.png

 

Now how do i add  index = waf_imperva . Thanks

 

Regards,

Roger

Labels (1)
0 Karma

sivakumar28
Loves-to-Learn

The query should have the result of index = waf_imperva. However, the result is not there. How to I ensure to include waf_imperva in the query or how do I troubleshoot why not there? 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Start with this and look to see when you last got events for that index and which host or host is was.

| tstats latest(_time) as LatestEvent where index=waf_imperva by host

Then back track from there to figure out why you don't have any events

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It is not clear what your expected result would look like - please can you explain further

0 Karma

sivakumar28
Loves-to-Learn

Do i need to include the IP address?

 

 

 

 

 

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Which ip address?

Did you find out if you have any events in that index?

What timeframe did you search over?

0 Karma

sivakumar28
Loves-to-Learn

 Hi ITWhisperer

| tstats latest(_time) as LatestEvent where index=waf_imperva by host

15 min time frame

Host                      Count
10.30.168.10 1699663326

 

Why query below is not providing this result? My humble request for a struggling engineer, May I have your whatsup?

| tstats latest(_time) as LatestEvent where index=* by index, host
| eval LatestLog=strftime(LatestEvent,"%a %m/%d/%Y %H:%M:%S")
| eval duration = now() - LatestEvent
| eval timediff = tostring(duration, "duration")
| lookup HostTreshold host
| where duration > threshold
| rename host as "src_host", index as "idx"
| fields - LatestEvent
| search NOT (index="cim_modactions" OR index="risk" OR index="audit_summary" OR index="threat_activity" OR index="endpoint_summary" OR index="summary" OR index="main" OR index="notable" OR index="notable_summary" OR index="mandiant")
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It looks like your host ip may not be in your lookup - please add the relevant information to the lookup.

0 Karma

sivakumar28
Loves-to-Learn

Hi @ITWhisperer ,

 

How do i do that? Any steps pls. Thanks.

 

 

Regards,

Siva Kumar

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Edit your lookup file and reload it, or use outputlookup to overwrite/update it.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...