Splunk Search

How can I replace Parenthesis in a URL field with Dots?

yossefn
Path Finder

Hi, 

I have a DNS logs with Parenthesis + numbers instead of Dots in the URL filed. 

How can I replace them with a Dots? 

Below are some examples from the logs. 

 

(5)_ldap(4)_tcp(5)cmp(6)_sites(3)rub(3)net(2)oz(0)
(4)wpad(3)rub(3)net(0)
(5)_ldap(4)_tcp(2)dc(6)_msdcs(9)dc(7)core(2)t4(3)rub(3)net(0)

 

 Thank you!

Labels (2)
Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Use SED.

| makeresults | eval data="(5)_ldap(4)_tcp(5)cmp(6)_sites(3)rub(3)net(2)oz(0)
(4)wpad(3)rub(3)net(0)
(5)_ldap(4)_tcp(2)dc(6)_msdcs(9)dc(7)core(2)t4(3)rub(3)net(0)"
| rex field=data mode=sed "s/(\(\d+)\)/./g"
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Use SED.

| makeresults | eval data="(5)_ldap(4)_tcp(5)cmp(6)_sites(3)rub(3)net(2)oz(0)
(4)wpad(3)rub(3)net(0)
(5)_ldap(4)_tcp(2)dc(6)_msdcs(9)dc(7)core(2)t4(3)rub(3)net(0)"
| rex field=data mode=sed "s/(\(\d+)\)/./g"
---
If this reply helps you, Karma would be appreciated.

yossefn
Path Finder

Wow, that was fast 🙂

Thanks @richgalloway for the solution!

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...