Reporting

cdr analysis area code

HansK
Path Finder

Hi,

I have field which contains telephonenumbers and would like to create a report on area codes, so I need to only use the first 3 digits of the field.

How is this done?

Tags (2)
0 Karma
1 Solution

Ayn
Legend

Grab the first 3 digits - there are multiple ways to do this. Either you use eval and substr:

... | eval areacode=substr(yourphonefield,1,3)

Or you could use rex:

... | rex field=yourphonefield "^(?<areacode>\d{3})"

View solution in original post

Ayn
Legend

Grab the first 3 digits - there are multiple ways to do this. Either you use eval and substr:

... | eval areacode=substr(yourphonefield,1,3)

Or you could use rex:

... | rex field=yourphonefield "^(?<areacode>\d{3})"
Get Updates on the Splunk Community!

Splunk Education - Fast Start Program!

Welcome to Splunk Education! Splunk training programs are designed to enable you to get started quickly and ...

Five Subtly Different Ways of Adding Manual Instrumentation in Java

You can find the code of this example on GitHub here. Please feel free to star the repository to keep in ...

New Splunk APM Enhancements Help Troubleshoot Your MySQL and NoSQL Databases Faster

Splunk Observability has two new enhancements to make it quicker and easier to troubleshoot slow or frequently ...