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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...