Splunk Enterprise

KV store lookup as array

arunssd
Loves-to-Learn

Hi 

 

I have a kv store lookup which populated automatically and it contains arrays . How can make it like a normal lookup that is searchable  or how to make it as a proper file 

 

current csv:

arunssd_0-1739878292623.png

 

 

I want the above kv store as a searchable lookup with proper segregation between each rows 

arunssd_0-1739878469721.png

 

 

Labels (1)
0 Karma

tscroggins
Influencer

Hi @arunssd,

If 1) your KV store collection uses array fields, 2) all field values have a 1:1:1:1 relationship, and 3) there are no empty/missing/null values within a field, i.e. all array values "line up":

asn                country    maliciousbehavior    riskscore
103.152.101.251 => PK      => 3                 => 9
103.96.75.159   => HK      => 3                 => 11
104.234.115.155 => CA      => 4                 => 9

you can transform the data with the transpose, mvexpand, and chart commands:

| inputlookup arunssd_kv
| transpose 0
| mvexpand "row 1"
| chart values("row 1") over _mkv_child by column
| fields - _mkv_child
| outputlookup arunssd_lookup.csv

However, your results may be truncated by mvexpand if the total size of the in-memory result is greater than the limits.conf max_mem_usage_mb setting (default: 500 MB). See https://docs.splunk.com/Documentation/Splunk/latest/Admin/Limitsconf#.5Bmvexpand.5D.

If this doesn't work for you, please share your collections.conf (KV store) and transforms.conf (lookup) settings. I used the following settings to test:

# collections.conf

[arunssd_kv]
field.asn = array
field.country = array
field.maliciousbehavior = array
field.riskscore = array

# transforms.conf

[arunssd_kv]
collection = arunssd_kv
external_type = kvstore
fields_list = asn,country,maliciousbehavior,riskscore

If your KV store fields are strings, the search can be adapted with the foreach and eval commands to coerce the fields values into a multi-valued type.

You can also transform the results from a shell using curl and jq or your scripting tools of choice.

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...