Tobitor
Tobitor

Reputation: 1508

Splunk: Split extracted field after specific position

I extracted a filed which contains phone numbers. The extracted field is named phoneNumbers. I now want to split this field after the fourth number to get the area code. How could I do this?

Thanks a lot!

Upvotes: 0

Views: 1073

Answers (1)

RichG
RichG

Reputation: 9916

Use the substr function.

... | eval areaCode = substr(phoneNumbers, 1, 3)

Upvotes: 1

Related Questions