Splunk Search

string to number conversion

kumar518g
Explorer

Hi All,
i have to convert an extracted field "responcetime" values like ":1389 ms",":345 ms" to number format .as the above field is of type as string its doing sorting as string but want it as number sorting so please help me.

Thanks in advance
Ravi

0 Karma
1 Solution

Ayn
Legend

Just make sure that the "responcetime" field only holds numbers, and Splunk should handle it numerically automatically. For instance you could use rex.

... | rex field=responcetime "^:(?<responcetime>\d+)" | ...

View solution in original post

Ayn
Legend

Just make sure that the "responcetime" field only holds numbers, and Splunk should handle it numerically automatically. For instance you could use rex.

... | rex field=responcetime "^:(?<responcetime>\d+)" | ...

kumar518g
Explorer

Thank u so much Ayn its worked perfectly now.
Regards
Ravi

0 Karma
Get Updates on the Splunk Community!

Introducing a Smarter Way to Discover Apps on Splunkbase

We’re excited to announce the launch of a foundational enhancement to Splunkbase: App Tiering. Because we’ve ...

How to Send Splunk Observability Alerts to Webex teams in Minutes

As a Developer Evangelist at Splunk, my team and I are constantly tinkering with technology to explore its ...

.conf25 Registration is OPEN!

Ready. Set. Splunk! Your favorite Splunk user event is back and better than ever. Get ready for more technical ...