Splunk Search

Why would the rex command ignore special characters in a search?

skhprabu
New Member

I have my log like

params=All Items | ABC | 2019-01-29 |  |  |  |  |  |  | = |  | = |  |  |  |  |  | ,uri=/api/items

this is my rex field in search

rex field=_raw"params\=(?<parameters>[^=]+)(?=\,uri)"

I expect parameters to save everything between "params=" and ",uri=/api/items"

parameters=All Items | ABC | 2019-01-29 |  |  |  |  |  |  | = |  | = |  |  |  |  |  |

but when i perform search it completel ignores all characters after equals to (=) symbol and shows only

All Items | ABC | 2019-01-29 |  |  |  |  |  |  | 

how should i fix my rex to include = as part of my search result

0 Karma
1 Solution

Vijeta
Influencer

Use the below rex command

rex field=_raw "params=(?<parameters>.*),uri="

View solution in original post

0 Karma

woodcock
Esteemed Legend

Use this instead:

... | rex "params\=(?<parameters>.+?)(?=\,uri)"

OR

... | rex "params\=(?<parameters>.+)\,uri="
0 Karma

Vijeta
Influencer

Use the below rex command

rex field=_raw "params=(?<parameters>.*),uri="
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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