Splunk Search

Re-Categorizing a URL

jaywilwk
Engager

This search shows the amount of traffic that goes across our network in GB. I want to be able to manually force googlevideo.com traffic to be categorized as social networking since our palo alto is categorizing as Audio/Video clips.

index=*** sourcetype=*** | stats sum(src_bytes) as GB by url category | eval GB=round(GB/1024/1024/1024,2) | sort -GB

0 Karma
1 Solution

aholzer
Motivator

You can use an eval statement that sets the category to "social networking" for anything that contains "googlevideo.com" in the url field, but if it doesn't contain "googlevideo.com" to leave the same category. Like so:

index=* sourcetype=* | eval category = if(like(url,"%googlevideo.com%"), "social networking", category) | stats sum(src_bytes) as GB by url category | eval GB=round(GB/1024/1024/1024,2) | sort -GB

Hope this helps

View solution in original post

aholzer
Motivator

You can use an eval statement that sets the category to "social networking" for anything that contains "googlevideo.com" in the url field, but if it doesn't contain "googlevideo.com" to leave the same category. Like so:

index=* sourcetype=* | eval category = if(like(url,"%googlevideo.com%"), "social networking", category) | stats sum(src_bytes) as GB by url category | eval GB=round(GB/1024/1024/1024,2) | sort -GB

Hope this helps

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