Dashboards & Visualizations

search for multiple value fields to multi column table

murat_ekren
Engager

title is bit confusing but I have a data like the below

date,assetname,assetIP
2020/05/05 10:00:00,esprbtrapmgr1,195.187.11.144
2020/05/05 10:00:00,nxc-webap2,10.186.36.196
2020/05/05 10:00:00,eytocesxc7p15,10.16.22.186
2020/05/05 10:00:00,eytocesxc7p15,10.16.22.18
2020/05/05 10:00:00,eytocesxc7p15,10.16.26.98
2020/05/05 10:00:00,aktocesxc16p08,10.16.26.21
2020/05/05 10:00:00,aktocesxc16p08,10.16.56.23

and I want a table like
any suggestions ?

assetname| assetIP |assetIP2 |assetIP3    ....
esprbtrapmgr1|195.187.11.144 
eytocesxc7p15 |10.16.22.186|10.16.22.18|10.16.26.98|
aktocesxc16p08|10.16.26.21|10.16.56.23
Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

This brute-force method works, but only with a fixed number of assetIP values.

| makeresults | eval _raw="assetname      assetIP
esprbtrapmgr1  195.187.11.144
nxc-webap2     10.186.36.196
eytocesxc7p15  10.16.22.186
eytocesxc7p15  10.16.22.18
eytocesxc7p15  10.16.26.98
aktocesxc16p08 10.16.26.21
aktocesxc16p08 10.16.56.23" | multikv forceheader=1
`comment("Above just sets test data")`
| stats values(assetIP) as assetIP by assetname
`comment("mvindex(assetIP, 0) must be last")`
| eval assetIP2=mvindex(assetIP, 1), assetIP3=mvindex(assetIP, 2), assetIP=mvindex(assetIP, 0)
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

murat_ekren
Engager

Thanks that worked 🙂

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This brute-force method works, but only with a fixed number of assetIP values.

| makeresults | eval _raw="assetname      assetIP
esprbtrapmgr1  195.187.11.144
nxc-webap2     10.186.36.196
eytocesxc7p15  10.16.22.186
eytocesxc7p15  10.16.22.18
eytocesxc7p15  10.16.26.98
aktocesxc16p08 10.16.26.21
aktocesxc16p08 10.16.56.23" | multikv forceheader=1
`comment("Above just sets test data")`
| stats values(assetIP) as assetIP by assetname
`comment("mvindex(assetIP, 0) must be last")`
| eval assetIP2=mvindex(assetIP, 1), assetIP3=mvindex(assetIP, 2), assetIP=mvindex(assetIP, 0)
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

What’s New & Next in Splunk SOAR

Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us on ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

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

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...