Splunk Search

Searching using timechart is too slow

xsstest
Communicator

I have a index naming is "IDS" . It's has 4 sourcetypes.
The event of the index is very large. an average of 1.3 million events in 10 minutes
I want to use timechart to show every 4 hours IDS alert trend. (on dashboard)
but timechart is too slow. Is there a faster search?

Below is my search:

index=IDS 
|eval ids=case(sourcetype="WAN-http" OR  sourcetype="WAN-ids","WAN",sourcetype="LAN-http" OR sourcetype="LAN-http","LAN")
|timechart count by ids
Tags (1)
0 Karma
1 Solution

FrankVl
Ultra Champion

Since the case statement in your eval is based on sourcetype, you're effectively doing a count by sourcetype. That can be done much faster using tstats.

| tstats count where index=IDS by sourcetype,_time
| eval ids=case(sourcetype="WAN-http" OR  sourcetype="WAN-ids","WAN",sourcetype="LAN-http" OR sourcetype="LAN-http","LAN")
| timechart sum(count) by ids

View solution in original post

0 Karma

FrankVl
Ultra Champion

Since the case statement in your eval is based on sourcetype, you're effectively doing a count by sourcetype. That can be done much faster using tstats.

| tstats count where index=IDS by sourcetype,_time
| eval ids=case(sourcetype="WAN-http" OR  sourcetype="WAN-ids","WAN",sourcetype="LAN-http" OR sourcetype="LAN-http","LAN")
| timechart sum(count) by ids
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 ...