Splunk Dev

How to remove Double quotes from a ip field values?

shivi_tcs
Engager

Hello All,

I have a field named src which contains IP's but with double quotes around them.
I want to remove the double quotes from these values.

Example
extracted value src="10.23.25.23"
needed value src=10.23.25.23

0 Karma
1 Solution

dineshraj9
Builder

Do it this way -

| eval src=replace(src,"\""."")

OR

| rex field=src "\"?(?<src>[\d\.]+)\"?"

View solution in original post

dineshraj9
Builder

Do it this way -

| eval src=replace(src,"\""."")

OR

| rex field=src "\"?(?<src>[\d\.]+)\"?"

Keysofsandiego
Path Finder

Hey great rex, but the eval does not workwith a period, atleast it didnt for me. I replaced the period (pun) with a comma and it is now working

 

| eval src=replace(src,"\"","")

 happy splunkin' pard 😁

0 Karma

shivi_tcs
Engager

thanks for the answer. It works well

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...