Splunk Search

Rename a Column?

JohnWright8
Path Finder

I'm processing some IIS log files with a search:
stats count max(time_taken) avg(time_taken) as avgTT by cs_uri_stem | fieldformat avgTT=round(avgTT/1000,2) |rename avgTT as "Avg Response Time"

But the result displays a column for both "Avg Response Time" (which seems to lack the rounding I just did) and ALSO displays an (empty) column named avgTT.

How do I do a search and then simply change the text of the column title?

1 Solution

somesoni2
Revered Legend

Try this

your base search | stats count max(time_taken)  avg(time_taken) as avgTT by cs_uri_stem | eval avgTT=round(avgTT/1000,2) |rename avgTT as "Avg Response Time"

View solution in original post

somesoni2
Revered Legend

Try this

your base search | stats count max(time_taken)  avg(time_taken) as avgTT by cs_uri_stem | eval avgTT=round(avgTT/1000,2) |rename avgTT as "Avg Response Time"

JohnWright8
Path Finder

Thank you! This works. For some reason "eval" works when "fieldformat" doesn't. Doesn't make any logical sense to me but thank you very much for providing a working solution!

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...