All Apps and Add-ons

values into multiple field

yuming1127
Path Finder

Hi,

cannot found anything similar to this issue, please guide me or forward any related thread to me. Thanks

my search......
| table product, product_tag sortby product,product_tag

Current output:

productproduct_tag
product1 A_tag1
product1 A_tag2
product1 B_tag1
product2C_tag1
product3D_tag1
product3D_tag2

 

Desired Output:

productproduct_tag1product_tag2product_tag3
product1 A_tag1A_tag2B_tag1
product2C_tag1NANA
product3D_tag1D_tag2NA

 

Regards,

Yu Ming

Labels (1)
Tags (3)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults 
| eval _raw="product	product_tag
product1 	A_tag1
product1 	A_tag2
product1 	B_tag1
product2	C_tag1
product3	D_tag1
product3	D_tag2"
| multikv forceheader=1
| fields - _* linecount


| streamstats count as row by product
| eval new_tag="product_tag".row
| eval {new_tag}=product_tag
| fields - row product_tag new_tag
| stats values(*) as * by product

yuming1127
Path Finder

hi,  for 

......

| eval _raw="product product_tag
product1 A_tag1
product1 A_tag2
product1 B_tag1
product2 C_tag1
product3 D_tag1
product3 D_tag2"

......

actually my data contain of thousands of product & product tag, what should i replace this with? my table command?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

This is a run-anywhere example to demonstrate what you could do.

The bit above the blank lines just creates some dummy data based on the example you posted, replace these lines with your search and modify the field names in the lower part so they match the fields your search is returning.

If you want to see how it is working, remove the lower part to see the dummy data, then add the lower part to see the solution in action.

0 Karma

yuming1127
Path Finder

Get it,
thanks for the quick reply and  great solution, really appreciate it.

0 Karma
Get Updates on the Splunk Community!

.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 ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...