Splunk Search

Get my single event in Tabular Format

rohithmn3
New Member

Hi Team,

My single Event looks like below:
FYI...

USER PID %CPU %MEM COMMAND
  daemon 6029500 0.2 0.0 .vasd
  daemon 5963962 0.1 0.0 .vasd
 auwasesp 13107344 0.0 1.0 java
 auwasesp 12714040 0.0 3.0 java
 auwasesp 12648618 0.0 0.0 java
 auwasesp 12517388 0.0 1.0 java
 auwasesp 12452016 0.0 1.0 java
 ausassrv 13434928 0.0 0.0 sas
 ausasadm 18022636 0.0 0.0 splunkd
 ausasadm 16384182 0.0 0.0 splunkd

I want this to be in Stats table, so that i can create dashboard out of it.
space is the delimiter. Pleas help me here..!

0 Karma

knielsen
Contributor

Maybe you want to look at multikv as well. So something like

<yoursearch> | multikv | stats values(*) as * by PID

DalJeanis
Legend

minor note - multikv assumes the table to be extracted is in the _raw field.

Here's a run-anywhere demo on the original poster's data...

| makeresults
| eval _raw ="blah garble anyoldstuff
 USER PID %CPU %MEM COMMAND
   daemon 6029500 0.2 0.0 .vasd
   daemon 5963962 0.1 0.0 .vasd
  auwasesp 13107344 0.0 1.0 java
  auwasesp 12714040 0.0 3.0 java
  auwasesp 12648618 0.0 0.0 java
  auwasesp 12517388 0.0 1.0 java
  auwasesp 12452016 0.0 1.0 java
  ausassrv 13434928 0.0 0.0 sas
  ausasadm 18022636 0.0 0.0 splunkd
  ausasadm 16384182 0.0 0.0 splunkd"
| multikv
0 Karma

adonio
Ultra Champion

if fields are extracted, then use | table
your search | table USER PID %CPU %MEM COMMAND
if fields are not extracted, click an event -> event actions -> extract fields - > delimiters - > space - > name your fields -> save
now run the search above

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...