Knowledge Management

Categorizing tags

sarahw3
Explorer

I have tags for the name of cameras and then tags for the status of the cameras that I created through eventtypes. Both of these tags are under the same tag category in my data and I want to create a panel that shows only the status tags. When I do |status count by tag it includes the name tags. Is it possible to categorize tags that are created through event types so that I could do something along the lines of |stats count by tag_status?

I have very little experience with splunk so any help would be fantastic!

0 Karma
1 Solution

woodcock
Esteemed Legend

Just drop or keep the tags you like with | regex tag="YourRegExHere" at the end. What is interesting about multi-valued fields (like tags) is that a single event will be counted in each value (each tag) so your counts for the tags that you'd like to keep should be correct. Just drop the stuff you don't need.

View solution in original post

woodcock
Esteemed Legend

Just drop or keep the tags you like with | regex tag="YourRegExHere" at the end. What is interesting about multi-valued fields (like tags) is that a single event will be counted in each value (each tag) so your counts for the tags that you'd like to keep should be correct. Just drop the stuff you don't need.

sarahw3
Explorer

I just tried using the regex with two tags as |regex tag="Working" OR tag="No_Images" and it does not like it. I have four specific tags that I want to count. What would that code look like? Will regex work with stats count?

0 Karma

DalJeanis
Legend
|regex tag="Working|No_Images|Tag3|Tag4"

sarahw3
Explorer

That helps! So now what do I write for the stats count function? Because if I do |stats count by tag it does it for all the tags I have instead of the four that I want.

0 Karma

sarahw3
Explorer

When I look at the events with '|regex tag="Working|No_Images|Tag3|Tag4"' it is only showing 167 when I have over 400,000

0 Karma

sarahw3
Explorer

Just kidding I had extra stuff in my search! But I am still having trouble with the count

0 Karma

sarahw3
Explorer

Yay I got it!! I needed to do the regex after the count! Thank y'all so so so much!

woodcock
Esteemed Legend

That's what I said in the first place ("at the end")! 😆 I am glad that you got it.

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...