Splunk Search

Rename the Values in the Json fields

Supriya
Path Finder

Hi,

Could someone please help me with the rename of the string Values in the fields.

I want to remove the spaces from the below-highlighted values

Supriya_0-1606282997524.png

here is the query I'm trying :

index="index" sourcetype=_json
|spath path="results{}.summary" output=Summary| spath path="results{}.description" output=Description
|spath path="results{}.category" output=Category |spath path="results{}.sysAdmin" output=SysAdmin
|rename Values(Summary) as values|rename values("User deactivated") AS "User_deactivated"
| table Summary Category SysAdmin

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

thambisetty
SplunkTrust
SplunkTrust

@Supriya  

try below:

| rex field=Summary mode=sed "s/\s+//g"

 

————————————
If this helps, give a like below.

View solution in original post

0 Karma

thambisetty
SplunkTrust
SplunkTrust

@Supriya  

try below:

| rex field=Summary mode=sed "s/\s+//g"

 

————————————
If this helps, give a like below.
0 Karma

Supriya
Path Finder

It's working,

Thank you very much for your prompt support @thambisetty 

0 Karma

thambisetty
SplunkTrust
SplunkTrust

@Supriya 

Do you want to remove spaces between Summary field values or new lines ?

————————————
If this helps, give a like below.
0 Karma

Supriya
Path Finder

removing spaces between Summary field values

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 ...