Splunk Enterprise Security

How To rename the field value name from the output.

hrs2019
Path Finder

Hi
I want to rename output field value name

Week1
1. Systems ops 12.1 to ops
2 .Systems dev 12.1 to dev

Below is the diagram for more info.
alt text

0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@hrs2019
You can use replace also.

https://docs.splunk.com/Documentation/SplunkCloud/8.0.1/SearchReference/Replace

| makeresults 
| eval Week1 ="Systems ops 12.1", "Number of tickets"=20 
| append 
    [| makeresults 
    | eval Week1 ="Systems dev 12.1", "Number of tickets"=15] 
| replace "Systems * 12.1" with "*" in Week1 | eval Week1=upper(Week1)
 | table Week1,"Number of tickets"

View solution in original post

to4kawa
Ultra Champion
| makeresults 
| eval Week1 ="Systems ops 12.1", "Number of tickets"=20 
| appendpipe 
    [| eval Week1 ="Systems dev 12.1", "Number of tickets"=15] 
| eval Week1=Upper(mvindex(split(Week1," "),1)) 
| table Week1,"Number of tickets"

Hi, @hrs2019
This is shortest and REGEX-free.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@hrs2019
You can use replace also.

https://docs.splunk.com/Documentation/SplunkCloud/8.0.1/SearchReference/Replace

| makeresults 
| eval Week1 ="Systems ops 12.1", "Number of tickets"=20 
| append 
    [| makeresults 
    | eval Week1 ="Systems dev 12.1", "Number of tickets"=15] 
| replace "Systems * 12.1" with "*" in Week1 | eval Week1=upper(Week1)
 | table Week1,"Number of tickets"

vnravikumar
Champion

Hi

Check this

| makeresults 
| eval Week1 ="Systems ops 12.1", "Number of tickets"=20
| append
    [| makeresults 
| eval Week1 ="Systems dev 12.1", "Number of tickets"=15] 
| eval Week1=case(Week1="Systems ops 12.1","OPS",Week1="Systems dev 12.1","Dev",1=1,Week1) 
| table Week1,"Number of tickets"
0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...