Dashboards & Visualizations

Any other way to compare between the same variable?

ViniciusMariano
Explorer

Hey Guys,

I have a problem: I have two time fields because one of the type source is json file and there is another script running, but now I have to mix both, so I created this eval:

 

| eval _time=if(match(source, "[(\S).json]\w+"), strptime(time, "%Y/%m/%d %H:%M:%S.%f"), _time)

 

but when I search I just receive the .json file search, so Is there any other way to "join"?, or at least the "if" statement ignore and just modify the json source?

Labels (1)
Tags (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The regex used in the match function appears to match more than is intended.  Because of the dot with the square brackets, the expression will match anything.  Try this command:

 

| eval _time=if(match(source, "\S\.json\w"), strptime(time, "%Y/%m/%d %H:%M:%S.%f"), _time)

 

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...