Splunk Search

How to graph the event count by sourcetype on a specific index per host over time?

dolejh76
Communicator

I have found a lot of ways to do one or the other of these, but short summary of what we have with theoretical numbers

10 hosts
10 logs per host going to one index

I would like to use the index as a starting point since I am specifically looking for event count that goes to that index. (Java Logs)

How would I graph the following please?

over 7 day period, what is the event count per log per host - 30 min buckets - end result would be something like...

host1 - log1 - 8:00-8:30 50 events
host1 - log2 - 8:00-8:30 50 events
host1 - log3 - 8:00-8:30 50 events
host1 - log4 - 8:00-8:30 50 events
host1 - log5 - 8:00-8:30 50 events
host2 - log1 - 8:00-8:30 50 events
host2 - log2 - 8:00-8:30 50 events
host2 - log3 - 8:00-8:30 50 events
host2 - log4 - 8:00-8:30 50 events
host2 - log5 - 8:00-8:30 50 events

etc...

Thanks
John

0 Karma
1 Solution

somesoni2
Revered Legend

Give this a try

| tstats count WHERE index=YourIndexHere by _time host sourcetype span=30m 

View solution in original post

somesoni2
Revered Legend

Give this a try

| tstats count WHERE index=YourIndexHere by _time host sourcetype span=30m 

dolejh76
Communicator

Love it so far - thanks!

0 Karma

dolejh76
Communicator

Spoke a little too soon... the table is exactly what I need.

The graph is just total count and is not separating by host / sourcetype. Is this something I need to configure on the graph or something that should be configured on the query? Worse case I can export to excel and graph on a pivot chart but would be nice to have it on a dashboard.

Thanks

JD

0 Karma

somesoni2
Revered Legend

Try this

| tstats count WHERE index=YourIndexHere by _time host sourcetype span=30m | eval metric=host.":".sourcetype | timechart span=30m sum(count) by metric

dolejh76
Communicator

Love it - thank you very much for your quit response - really appreciate it!

0 Karma
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

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 ...