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!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...