All Apps and Add-ons

Dashobard charts

rapidmobstar
New Member

Hi,

Sorry noob with splunk and I have a problem, not sure where to start but looking for some hints or tips.

Problem: I am extracting CDR (Call Detail Records) from my VoIP system into splunk. I have a field in the extraction called id_dialed_num that contains the dial string the station dialled. I'm looking to chart this field into a pie chart under three categories;

  1. mobile any number starting with 07
  2. Local any number stating with 0, then [1-6]?[8-9]
  3. International any number starting with international dial codes.

Any ideas where to start?
Thanks

0 Karma
1 Solution

DavidHourani
Super Champion

Hello Rapidmobstar,

You can easily do that using an eval/ case expression.

Your search should look something like that:

*your search* | eval Type= "International Number" | eval Type=case(match(PHONENUMBER,"^07*"),"Mobile Number",
match(PHONENUMBER,"^0[1-6]|[8-9]*"),"Local Number") | stats count by Type

Adding this eval to your search will first set the field "Type" to international for all your numbers. Then in case the number starts with 07 will change the Type to Mobile Number. And in case it is a local number it will set the type to local (Local number is starts with 0 then something [1-6] or [8-9] )

Regards,

David

View solution in original post

0 Karma

DavidHourani
Super Champion

Hello Rapidmobstar,

You can easily do that using an eval/ case expression.

Your search should look something like that:

*your search* | eval Type= "International Number" | eval Type=case(match(PHONENUMBER,"^07*"),"Mobile Number",
match(PHONENUMBER,"^0[1-6]|[8-9]*"),"Local Number") | stats count by Type

Adding this eval to your search will first set the field "Type" to international for all your numbers. Then in case the number starts with 07 will change the Type to Mobile Number. And in case it is a local number it will set the type to local (Local number is starts with 0 then something [1-6] or [8-9] )

Regards,

David

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