Splunk Dev

How to bucket fields with and without quotes together

BlueBjorn
Engager

A recent change to logs has broken my dashboard panels and reporting. I'm struggling to find the best way to modify my search criteria to pick up data prior to the change and after. It's a very simple change as single quotation marks were added around the field but it's giving me a big headache. 

index=prd sourcetype=core Step=* Time=* |  timechart avg(Time) by Step span=1d

Field in event log changed:

FROMStep=CONVERSION_APPLICATION

TOStep='CONVERSION_APPLICATION'  (with single quotation marks)

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Strip the quotes with the trim function.

index=prd sourcetype=core Step=* Time=* 
| eval Step=trim(Step, "'")
| timechart avg(Time) by Step span=1d

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

BlueBjorn
Engager

That worked. Thank you very much!! 

richgalloway
SplunkTrust
SplunkTrust

Strip the quotes with the trim function.

index=prd sourcetype=core Step=* Time=* 
| eval Step=trim(Step, "'")
| timechart avg(Time) by Step span=1d

 

---
If this reply helps you, Karma would be appreciated.
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 ...