Splunk Enterprise Security

How do i extract certain fields and data from _raw and display in table form@ eg

NayneshPatel
New Member

How do i extract certain fields and data from _raw and display in table form@ eg

_raw
[{"Conutry":"America","State":"Nevada","Population":"6564654"},{"Conutry":"America","State":"California","Population":"42475"}]

many thanks

0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@NayneshPatel

Try this.

YOUR_SEARCH | spath | rename {}.* as * | eval tmp=mvzip(mvzip(Conutry,State),Population) | mvexpand tmp | eval Conutry=mvindex(split(tmp,","),0),State=mvindex(split(tmp,","),1),Population=mvindex(split(tmp,","),2) | table Conutry, State ,Population

Sample:

| makeresults | eval _raw="[{\"Conutry\":\"America\",\"State\":\"Nevada\",\"Population\":\"6564654\"},{\"Conutry\":\"America\",\"State\":\"California\",\"Population\":\"42475\"}]"| spath | rename {}.* as * | eval tmp=mvzip(mvzip(Conutry,State),Population) | mvexpand tmp | eval Conutry=mvindex(split(tmp,","),0),State=mvindex(split(tmp,","),1),Population=mvindex(split(tmp,","),2) | table Conutry, State ,Population

View solution in original post

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@NayneshPatel

Try this.

YOUR_SEARCH | spath | rename {}.* as * | eval tmp=mvzip(mvzip(Conutry,State),Population) | mvexpand tmp | eval Conutry=mvindex(split(tmp,","),0),State=mvindex(split(tmp,","),1),Population=mvindex(split(tmp,","),2) | table Conutry, State ,Population

Sample:

| makeresults | eval _raw="[{\"Conutry\":\"America\",\"State\":\"Nevada\",\"Population\":\"6564654\"},{\"Conutry\":\"America\",\"State\":\"California\",\"Population\":\"42475\"}]"| spath | rename {}.* as * | eval tmp=mvzip(mvzip(Conutry,State),Population) | mvexpand tmp | eval Conutry=mvindex(split(tmp,","),0),State=mvindex(split(tmp,","),1),Population=mvindex(split(tmp,","),2) | table Conutry, State ,Population
0 Karma

NayneshPatel
New Member

Perfect thanks you

Not sure if you can further help me,

From the Field Population, can you filter out the results so if it contains anything other then "6564654" and "42475", then show the results. along with county and state

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@NayneshPatel

For excluding events having Population value 6564654 & 42475, just append below search with existing.

| search NOT (Population IN (6564654,42475))

0 Karma

NayneshPatel
New Member

Brilliant, thanks Kamlesh

0 Karma
Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...