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!

Announcing Scheduled Export GA for Dashboard Studio

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

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 GA in US-AWS!

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