I have a string called PGMNM. The contents of PGMNM are "AE248 \AX0\AX0". I want to use the rex function to slice the PGM_NM string to just be AE248. So essentially I want to slice the string up to the whitespace. Thanks!
This should work:
<generating search> | rex field=PGM_NM "(?<value>[\S]+)\s.*"
Please let me know if this answers your question!
View solution in original post
your base search | eval PGM_NM=mvindex(split,PGM_NM," "),0)
your base search | eval PGM_NM=replace(PGM_NM,"^(\S+)(.*)","\1")
I used PGM_NM as the value and it worked perfectly. Thank you very much!