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!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...