Splunk Search

How to merge remaining fields into a multivalue field after dedup'ing one field?

russell120
Communicator

Hi,

Just as the question says. My current search results in something similar to this:

ip       device
--------------------
111     workstation
--------------------
111     cell_phone
--------------------
111      router
--------------------

Running |dedup ip deletes two entire rows without keeping all 3 device values. Instead, I'd like to have it merge the device field into a multivalue field when duplicate ip values are found like so:

ip       device
--------------------
        workstation
111     cell_phone
         router
--------------------

What command(s) do I need to accomplish this?

0 Karma
1 Solution

pkeenan87
Communicator

stats command should work here

base search....
| stats values(device) as device by ip

View solution in original post

0 Karma

pkeenan87
Communicator

stats command should work here

base search....
| stats values(device) as device by ip
0 Karma

russell120
Communicator

Ah I was having a brain fart. This did the trick, thanks.

0 Karma

daljeanis_rtp
New Member

| stats values(device) as device by ip

0 Karma
Get Updates on the Splunk Community!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...