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!

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 ...