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
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...