Splunk Search

How to extract the new field into interesting field from raw event?

Nagalakshmi
Path Finder

Hi Team,

we are trying to add new field  as a display name into interesting field from below raw event




DisplayName: sample-Hostname

We tried the below query but it is not working 

| rex field=_raw \"DisplayName", "Value":\s(?<DisplayName>\w+).

And also please suggest us how to create a query if the user logged in one or more devices.

Thanks in advance!

Labels (2)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @Nagalakshmi ,

good for you, see next time!

let me know if I can help you more, or, please, accept one answer for the other people of Community.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

View solution in original post

Nagalakshmi
Path Finder

Hi @gcusello ,

Thanks for the quick response!

The above query is perfectly working


0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Nagalakshmi ,

good for you, see next time!

let me know if I can help you more, or, please, accept one answer for the other people of Community.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

gcusello
SplunkTrust
SplunkTrust

Hi @Nagalakshmi ,

this seems to be a json log, so you can extract all fields using the "INDEXED_EXTRACTION = json" in the props.conf or using the "spath" command.

If you want to use a regex, you can use:

| rex "DisplayName\",\s+\"Value\":\s+\"(?<DisplayName>[^\"]+)"

that you can test at https://regex101.com/r/hjQXGU/1

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...