Splunk Search

How to remove part of my value to create a new value?

Robbie1194
Communicator

Hi guys,

My goal is to remove part of my value to create a new value.

For example, I have a field called created_time = 1517789420.357994. Does anyone know a way of getting newCreatedTime = 1517789420?

I basically just want the .* to go away!

Any help would be appreciated.

Cheers!

0 Karma
1 Solution

micahkemp
Champion
| eval newCreatedTime=floor(created_time)

View solution in original post

cmerriman
Super Champion

@micahkemp 's answer is great, you could also try |eval newCreatedTime =mvindex(split(created_time,"."),0) I only mention this in case you ever need to split a field that isn't numeric. http://docs.splunk.com/Documentation/SplunkCloud/7.0.0/SearchReference/MultivalueEvalFunctions

0 Karma

micahkemp
Champion
| eval newCreatedTime=floor(created_time)
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...