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!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...