Hi,
I have a field which produces a value like this example: DB=HR_10_7_3043_TGTHRLIVE
I am trying extract the number and write it in the following way: DB_Version=10.7.3043
How do I get Splunk to cut off before and after the number and then replace the _ with .
Note: The strings before and after the numbers can vary in length, and the number can vary too.
Many thanks,
Sam
Hi @samwatson45 ,
try this run anywhere search:
|makeresults|eval DB="HR_10_7_3043_TGTHRLIVE"|rex field=DB "^[A-Za-z]+_(?<DB_Version>\w+)_\w+"| eval DB_Version=replace(DB_Version,"_",".")
Hi @samwatson45 ,
try this run anywhere search:
|makeresults|eval DB="HR_10_7_3043_TGTHRLIVE"|rex field=DB "^[A-Za-z]+_(?<DB_Version>\w+)_\w+"| eval DB_Version=replace(DB_Version,"_",".")
Perfect thank you 🙂