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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...