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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...