Splunk Search

Service logs count very less to a particular host

kgaurav
Observer

I'm having trouble writing a query which displays the action and host count where log count is below average on any host.

The output would look something like this:

 

actionhost1host2host3host4host5host6
getdata234042260022592882251222244
Labels (1)
0 Karma

manjunathmeti
Champion

hi @kgaurav ,

Try this:

index=index 
| stats count by action, host 
| eventstats avg(count) as avg by action 
| eval count=if(count>=avg, count, "(".count.")") 
| fields action, host, count 
| xyseries action, host, count

 

If this reply helps you, an upvote/like would be appreciated.

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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