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!

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...

Announcing the 1st Round Champion’s Tribute Winners of the Great Resilience Quest

We are happy to announce the 20 lucky questers who are selected to be the first round of Champion's Tribute ...

We’ve Got Education Validation!

Are you feeling it? All the career-boosting benefits of up-skilling with Splunk? It’s not just a feeling, it's ...