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!

Getting Started with AIOps: Event Correlation Basics and Alert Storm Detection in ...

Getting Started with AIOps:Event Correlation Basics and Alert Storm Detection in Splunk IT Service ...

Register to Attend BSides SPL 2022 - It's all Happening October 18!

Join like-minded individuals for technical sessions on everything Splunk!  This is a community-led and run ...

What's New in Splunk Cloud Platform 9.0.2208?!

Howdy!  We are happy to share the newest updates in Splunk Cloud Platform 9.0.2208! Analysts can benefit ...