<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: KV store lookup as array in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/KV-store-lookup-as-array/m-p/712313#M21701</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/276568"&gt;@arunssd&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;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":&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;asn                country    maliciousbehavior    riskscore
103.152.101.251 =&amp;gt; PK      =&amp;gt; 3                 =&amp;gt; 9
103.96.75.159   =&amp;gt; HK      =&amp;gt; 3                 =&amp;gt; 11
104.234.115.155 =&amp;gt; CA      =&amp;gt; 4                 =&amp;gt; 9&lt;/LI-CODE&gt;&lt;P&gt;you can transform the data with the transpose, mvexpand, and chart commands:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| inputlookup arunssd_kv
| transpose 0
| mvexpand "row 1"
| chart values("row 1") over _mkv_child by column
| fields - _mkv_child
| outputlookup arunssd_lookup.csv&lt;/LI-CODE&gt;&lt;P&gt;However, your results may be truncated by mvexpand if the total size of the in-memory result is greater than the limits.conf&amp;nbsp;max_mem_usage_mb setting (default: 500 MB). See&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Limitsconf#.5Bmvexpand.5D" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Admin/Limitsconf#.5Bmvexpand.5D&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;# 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&lt;/LI-CODE&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;You can also transform the results from a shell using curl and jq or your scripting tools of choice.&lt;/P&gt;</description>
    <pubDate>Sun, 23 Feb 2025 17:51:43 GMT</pubDate>
    <dc:creator>tscroggins</dc:creator>
    <dc:date>2025-02-23T17:51:43Z</dc:date>
    <item>
      <title>KV store lookup as array</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/KV-store-lookup-as-array/m-p/711906#M21674</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a kv store lookup which populated automatically and it contains arrays . How can make it like a normal lookup that is searchable&amp;nbsp; or how to make it as a proper file&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;current csv:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arunssd_0-1739878292623.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/34607iB4834081C35F179D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arunssd_0-1739878292623.png" alt="arunssd_0-1739878292623.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the above kv store as a searchable lookup with proper segregation between each rows&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arunssd_0-1739878469721.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/34609i2D61A24AC603886B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arunssd_0-1739878469721.png" alt="arunssd_0-1739878469721.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 11:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/KV-store-lookup-as-array/m-p/711906#M21674</guid>
      <dc:creator>arunssd</dc:creator>
      <dc:date>2025-02-18T11:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: KV store lookup as array</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/KV-store-lookup-as-array/m-p/712313#M21701</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/276568"&gt;@arunssd&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;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":&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;asn                country    maliciousbehavior    riskscore
103.152.101.251 =&amp;gt; PK      =&amp;gt; 3                 =&amp;gt; 9
103.96.75.159   =&amp;gt; HK      =&amp;gt; 3                 =&amp;gt; 11
104.234.115.155 =&amp;gt; CA      =&amp;gt; 4                 =&amp;gt; 9&lt;/LI-CODE&gt;&lt;P&gt;you can transform the data with the transpose, mvexpand, and chart commands:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| inputlookup arunssd_kv
| transpose 0
| mvexpand "row 1"
| chart values("row 1") over _mkv_child by column
| fields - _mkv_child
| outputlookup arunssd_lookup.csv&lt;/LI-CODE&gt;&lt;P&gt;However, your results may be truncated by mvexpand if the total size of the in-memory result is greater than the limits.conf&amp;nbsp;max_mem_usage_mb setting (default: 500 MB). See&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Limitsconf#.5Bmvexpand.5D" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Admin/Limitsconf#.5Bmvexpand.5D&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;# 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&lt;/LI-CODE&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;You can also transform the results from a shell using curl and jq or your scripting tools of choice.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2025 17:51:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/KV-store-lookup-as-array/m-p/712313#M21701</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2025-02-23T17:51:43Z</dc:date>
    </item>
  </channel>
</rss>

