Splunk Search

how can i do to extract with REX

guillecasco
Path Finder

URR: /UMY/t5/update/?body-hash=6764545kk345565e1e9c946034gg&environment=350789e8-j235-4f5c-95f2-lmnu9458b

how can i use rex to extract those numbers and leters that is next to enviroment= . There are many logs with those lines . That number represent a unice id for some device that hits some backend. I then need to do a table with every single device extracted in the last 15 days for example

thanks!

Tags (2)
0 Karma

Richfez
SplunkTrust
SplunkTrust

If it is always the last thing on the line,

rex "environment=(?<MyFieldName>\S+)$"

If it is not, drop the last dollar sign off and it'll ONLY grab up to the next space.

Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...