Splunk Search

How to do timechart on a field that has same name but different alert level?

wuming79
Path Finder

Hi,

I have a log with a field call "Event_Types" and then another field call "Alert Level" .
In my logs there is an event call "Ping" but this "Ping" has 2 Alert Levels 6 and 10.
I want to do a timechart on Event_Types but also want to show that there are 2 pings with different alert levels counted over time. How should I search for it?

Alert_Level > 6 | timechart count(Event_Types) as Event_Types count(Alert_Level) will show "The argument 'count(Alert_Level)' is invalid."

0 Karma
1 Solution

somesoni2
Revered Legend

Give this a try
Updated: Fixed typo with field name

your base search | eval EventType=Event_Types.":".Alert_Level | timechart count by EventType

OR

your base search  | where Alert_Level > 6 | eval EventType=Event_Types.":".Alert_Level | timechart count by EventType

View solution in original post

0 Karma

wuming79
Path Finder

Hi somesoni2,

the search show all NULL.

alt text

0 Karma

somesoni2
Revered Legend

@wuming79, there was a typo in my original answer (thanks @niketnilay for pointing that one out), which may be causing that NULL column name. Try the updated answer.

0 Karma

somesoni2
Revered Legend

Give this a try
Updated: Fixed typo with field name

your base search | eval EventType=Event_Types.":".Alert_Level | timechart count by EventType

OR

your base search  | where Alert_Level > 6 | eval EventType=Event_Types.":".Alert_Level | timechart count by EventType
0 Karma

niketn
Legend

@somesoni2, I think field name is Event_Types and not Event_Type.
@wuming79, can you please confirm the field names Event_Types and Alert_Level?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

wuming79
Path Finder

Hi, it's working now. Thanks! 🙂

0 Karma

niketn
Legend

Are you trying a query like the following?

| where Alert_Level > 6 | timechart count(Event_Types) as Event_Types count(Alert_Level) as Alert_Level
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

wuming79
Path Finder

Hi sorry, I made a mistake, I need it to display "|Alert_Level > 6 | timechart count(Event_Types) by Event_Types count(Alert_Level) "

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...