Dashboards & Visualizations

rename column name

simo
Path Finder

hi 

I have a column with the following name

transactionId: N/A

the value after :  it can take on more values 

transactionId: start

how can I rename it so that it always takes the value transactionId ?

Thanks for your help 🙂

Simone

 

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Do you mean something like this?

| makeresults
| eval transactionid="start"
| eval {transactionid}=transactionid
0 Karma

simo
Path Finder

hi @ITWhisperer 

start is the name that the column takes, the field can be called

"transactionId: N/A" OR "transactionId: start" 

I would like to rename it "transactionId" depending on the name it takes

simone

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults 
| eval transactionid=split("transactionid: start,transactionid: N/A",",")
| mvexpand transactionid
| streamstats count as row 
| eval {transactionid}=mvindex(split("AB",""),row%2)
| fields - transactionid _time row
| foreach "transactionid: *"
    [| eval transactionid=coalesce(transactionid,'<<FIELD>>')]

You can't have more than one field with the same name but you can eval a field more than once

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...