Splunk Search

Renaming field name having #

ccflsampa
New Member

How can I rename a field name starting with # in Splunk search tab?
For example: field name I have "#client Name" and I want to rename it as "clientName"

Thanks!

Tags (1)
0 Karma

ccflsampa
New Member

Thank you!
I am able to rename the field name with # (successfully renamed # MHCP Cases to MHCPCases)
but while saving the results to the dashboard I am getting the error (The dataset "RootObject" has no field " MHCP Cases" ). How can I avoid this error?

0 Karma

Shan
Builder

@ ccflsampa : I hope you got your answer. If the above commands helps. Please accept the answer and close the question.

0 Karma

Shan
Builder

yes i accept with @ssadanala1.
I hope you need to rename the field name in spl query right. If yes is your answer.
Then you can use simple rename command and change the field name.

Example :

| makeresults
|eval "#Data" = 1
|eval "#client Name"="study"
|rename #Data as Data, "#client Name" as "client Name"

You can simply use this for renaming your field..
|rename #Data as Data, "#client Name" as "client Name"

0 Karma

ssadanala1
Contributor

Please try this

| makeresults 
|eval "#hello" = "1"|eval "#hola"="2"
|rename #* as *
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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...