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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...