Reporting

Search Optimization on my query

bapun18
Communicator

Hi,
I have a query that is giving me results in around 60-70 seconds I wanted to reduce the time, seems NOT is taking more time and my search is parsing for around 35-40 seconds. Please help me to optimize the below query so that it will run within 30 seconds.

index=syslogs earliest=-5m
| fields _time host SYSLOG_mne SYSLOG_message
| rename host as device_ip
| dedup device_ip
| search NOT
[| inputlookup my_devices_lookup
| dedup device_ip
| table device_ip]
| fields _time device_ip SYSLOG_mne SYSLOG_message
| stats values(device_ip) by _time SYSLOG_mne SYSLOG_message

Labels (2)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @bapun18,

Please try this below;

 index=syslogs earliest=-5m
| lookup my_devices_lookup device_ip as host OUTPUTNEW device_ip as found
| where isnull(found)
| stats values(device_ip) by _time SYSLOG_mne SYSLOG_message

 

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

scelikok
SplunkTrust
SplunkTrust

Hi @bapun18,

Please try this below;

 index=syslogs earliest=-5m
| lookup my_devices_lookup device_ip as host OUTPUTNEW device_ip as found
| where isnull(found)
| stats values(device_ip) by _time SYSLOG_mne SYSLOG_message

 

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
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 ...