Splunk Search

How to edit my search to reformat results in a table?

Tim_1
Path Finder

Hi all,

I'm new to Splunk, and been stuck at trying to format a table of results.

I currently have the a raw results table that looks something like this:

VendorID     VendorCoOrd         Products
 1001          (120)                      one
 1001          (120)                      two
 1001          (120)                      three
 1001          (1)                        one
 1001          (2)                        one
 1002          (1)                        one
...

What I've currently achieved:

VendorID     VendorCoOrd         Products
 1001          (120)                      one
               (1)                        two
               (2)                        three
                                          one
                                          one
 1002          (1)                        one
...

Using the following query:

| stats values(VendorCoOrd) AS VendorCoOrd, values(product_name) AS Products BY VendorID

However, what I want to achieve is this:

VendorID     VendorCoOrd         Products
 1001          (120)                      one
                                          two
                                          three
               (1)                        one
               (2)                        one
 1002          (1)                        one
...

Any advice on how to achieve this result?

Thanks.

0 Karma

sundareshr
Legend

Try this

| stats values(product_name) AS Products BY VendorID VendorCoOrd
0 Karma

Tim_1
Path Finder

Hi @sundareshr

Thanks for the suggestion, but I have tried that before and it only results in the following:

VendorID     VendorCoOrd         Products
 1001          (120)                      one
                                          two
                                          three
 1001          (1)                        one
 1001          (2)                        one
 1002          (1)                        one
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...