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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...