Splunk Search

Splunk Regular Expression

AHEARNJ
Explorer

I am trying to extract a filed using. | rex field=_raw
I used regexr to create a regular expression with an exclude group and a capture group.
I have this working, but can't seem to format this for Splunk.
Any good tips for Regex and Splunk?
Regex I am using:

 (?:<entry key="applications" value=")([a-zA-Z0-9 ]+)(?:"\/>)

String extracting the value from:

<entry key="applications" value="AD Users"/>

Any help you can provide is greatly appreciated.

Thanks,

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Your regex string doesn't contain field extractions so the rex command is not doing anything for you. Another factor is the rex command requires quotation marks be escaped. See if this helps you.

... | rex "<entry key=\"applications\" value=\"(?<appValue>[a-zA-Z0-9 ]+)\"\/>" | ...
---
If this reply helps you, Karma would be appreciated.
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, ...