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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...