Hello,
I am trying to figure out how to rex extract from text that starts with a newline and ends with a newline. For example: \\nCAR PRODUCT: bat mobile\n
Does anyone know a good way around this situation so that only "bat mobile" is extracted?
Thank you for your help.
Spencer
Giuseppe,
Thank you for your help.
I am trying to rex extract "bat mobile" from something similar to the following raw text.
As you can see there is a newline following "bat mobile". I am having trouble figuring out how to rex "bat mobile" only and not get everything after "bat mobile".
example: \\nDAMAGED PRODUCT: bat mobile\nmail:sneal@gmail.com
my current code is:
|rex “DAMAGED PRODUCT: (?P<SWN>.+?)"
However, I don't know what to put after the second parentheses so that rex will only extract "bat mobile".
I hope my thought makes sense.
Once again, thank you greatly for your help.
Spencer
Hi @spencerneal,
as I said, the only way I can help you is that you share some samples (not one!) of your logs: eventually mask sensible contents but don't change the log structure.
Ciao.
Giuseppe
Hi @spencerneal,
the request is just a little vague because if in your events you have more lines, you'll have more extractions, is this what you want?
Otherwise please give more details in extraction and, please, share some sample of your data highlighting the parts to extract.
Ciao.
Giuseppe