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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...