How to extract the following user and move it to a field in Splunk?
message: xad="/home/andy"
message: xad="/home/george"
message: xad="/home/cindy"
and a lot more..
I would like to get an output as follows. Because of the quote " before /home, Splunk rejected my regex. Please help. Thanks
user
====
andy
george
cindy
You obviously has a field named xad. From this, no need for rex.
| eval user = mvindex(split(xad, "/"), 1)
I think @yuanliu meant
| eval user = mvindex(split(xad, "/"), 2)
Having said that, can you share the failed rex and/or the full events (anonymised, of course) in a code block </> to preserve the format of the event?