Getting Data In

event with time record

benji00
New Member

Hello,

I have a field containing an execution time looking like: 100s and which is corresponding to 100 seconds.
The field is only in second, so my concern is only to remove the final S to have a field with only numbers, any idea about how to do?

Regards,

Tags (1)
0 Karma
1 Solution

renjith_nair
Legend

@benji00 ,

Try

|rex field=execution_time "(?<sec>\d+)"

where execution_time is your field name

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

@benji00 ,

Try

|rex field=execution_time "(?<sec>\d+)"

where execution_time is your field name

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

benji00
New Member

@renjith.nair,
OK but then how can I call my filtered out field?
Because at the end I want to use it to calculate a difference with another sub-process execution time (already conatining only numbers)...

0 Karma

benji00
New Member

Thanks... it is working as expected (y)

0 Karma

renjith_nair
Legend

@benji00 ,
The seconds will be in the field sec . You may use any other field name

See this run anywhere example

|makeresults|eval execution_time="100s"|rex field=execution_time "(?<seconds>\d+)"|fields execution_time,seconds
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...