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!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...