Splunk Search

How can I convert a text string to a number?

Path Finder

I have a field that contains a text string representing time ("900 ms" for example - all values are in milliseconds) is there a way to extract a number, so i can find values "greater than" or "smaller than"?

0 Karma
1 Solution

Super Champion

try this

...|rex field=<fieldname> "(?<ms>\d+)"

include your fieldname here

View solution in original post

0 Karma

Builder

Hello,

Can you try this please:

|makeresults | eval field="900 ms" | rex field=field "(?<field>\d+)"

Regards

0 Karma

Super Champion

try this

...|rex field=<fieldname> "(?<ms>\d+)"

include your fieldname here

View solution in original post

0 Karma

Path Finder

thanks !!!

0 Karma