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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...