Splunk Search

How can I convert a naive timechart command to an efficient one?

ddrillic
Ultra Champion

The following works fine for me -

sourcetype=<sourcetype> index=<index> | timechart span=1d count 

How can I convert it to an efficient eventstats or tstats command?

0 Karma
1 Solution

somesoni2
Revered Legend

The tstats version will be like this

| tstats count WHERE index=<index> sourcetype=<sourcetype> by _time span=1d 

If you don't the visualization right, just add this as well to above search

above search | timechart span=1d sum(count) as count

View solution in original post

0 Karma

somesoni2
Revered Legend

The tstats version will be like this

| tstats count WHERE index=<index> sourcetype=<sourcetype> by _time span=1d 

If you don't the visualization right, just add this as well to above search

above search | timechart span=1d sum(count) as count
0 Karma

ddrillic
Ultra Champion

Gorgeous @somesoni2. You put a new picture! - I'm afraid to put mine - too scary ; -)

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...