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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...