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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...