Splunk Search

lookup multi value

ChetanArgekar
Explorer

I have multiple devices in a given location maintaining it lookup table with location and device.

Using location from index I am trying to get device list but output is coming in single row. I want list of devices as separate row. How to achieve it.

My query is like this

index =myindex

| lookup mylookup location OUTPUT devices 

| table devices

 

Labels (2)
0 Karma
1 Solution

ChetanArgekar
Explorer

Solved.

index = myindex

| lookup mylookup location OUTPUT devices 

| stats count(devices) by location, devices

| table devices 

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ChetanArgekar,

please, try something like this:

index =myindex
| append [ | inputlookup mylookup | fields location devices ]
| stats values(devices) AS devices by location
| mvexpand devices

Ciao.

Giuseppe

0 Karma

ChetanArgekar
Explorer

thanks

It is giving only one device of location. I want list of every device of the location in separate row

0 Karma

ChetanArgekar
Explorer

Solved.

index = myindex

| lookup mylookup location OUTPUT devices 

| stats count(devices) by location, devices

| table devices 

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...