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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...