Splunk Search

Help with regex..?

prakash007
Builder

Need help with regex...should start with " end with space or ?

Need entire string in a field starting with " and end until j.prod or c.cat etc...

 "GET /brit-pocket09fress/cprod121000019___/j.prod HTTP/1.1"

  "GET /nprod789jkj908989heys__/j.prod?icid=&searchType=

  "GET /Zin-carsposn-vwlvet-09878__/c.cat HTTP/1.1"
0 Karma
1 Solution

somesoni2
Revered Legend

Try this

your base search |rex field=yourfield "\"(?<SomefieldName>\S+\s+[^\s\?]+)"

View solution in original post

0 Karma

woodcock
Esteemed Legend

Like this:

(?<myCapture>"[^\s]+\s+[^\s?]+)(?<=\/)
0 Karma

prakash007
Builder

some how it's giving me the date when i do | rex field=_raw (?"[^\s]+\s+[^\s?]+)(?<=\/) | table myCapture, _raw

0 Karma

somesoni2
Revered Legend

Try this

your base search |rex field=yourfield "\"(?<SomefieldName>\S+\s+[^\s\?]+)"
0 Karma
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 ...