<?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 Multiple values per key in one record in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70985#M17761</link>
    <description>&lt;P&gt;If I have records with multiple k/v pairs with the same keyname, can I parse that through Splunk search language or by massaging the confs so that each k/v pair is reflected in the results of searches against it?&lt;/P&gt;

&lt;P&gt;For instance, assuming these records are alone in their index:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;3/30/2011 04:53:22 index=Org_Personnel Name=Herbert Name=Yancey Name=Bartleby Department=Acquisitions 

3/30/2011 04:53:22 index=Org_Personnel Name=Carol Name=Cyril Name=Lana Name=Mallory Department=IT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(the second line is to illustrate that number of kv pairs can vary from one record to the next)&lt;/P&gt;

&lt;P&gt;Now my simple search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Org_Personnel |stats count(name)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How would I make that return "7" instead of "2" as it would without modification?&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;

&lt;P&gt;-s&lt;/P&gt;</description>
    <pubDate>Wed, 30 Mar 2011 22:32:08 GMT</pubDate>
    <dc:creator>blurblebot</dc:creator>
    <dc:date>2011-03-30T22:32:08Z</dc:date>
    <item>
      <title>Multiple values per key in one record</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70985#M17761</link>
      <description>&lt;P&gt;If I have records with multiple k/v pairs with the same keyname, can I parse that through Splunk search language or by massaging the confs so that each k/v pair is reflected in the results of searches against it?&lt;/P&gt;

&lt;P&gt;For instance, assuming these records are alone in their index:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;3/30/2011 04:53:22 index=Org_Personnel Name=Herbert Name=Yancey Name=Bartleby Department=Acquisitions 

3/30/2011 04:53:22 index=Org_Personnel Name=Carol Name=Cyril Name=Lana Name=Mallory Department=IT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(the second line is to illustrate that number of kv pairs can vary from one record to the next)&lt;/P&gt;

&lt;P&gt;Now my simple search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Org_Personnel |stats count(name)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How would I make that return "7" instead of "2" as it would without modification?&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;

&lt;P&gt;-s&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2011 22:32:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70985#M17761</guid>
      <dc:creator>blurblebot</dc:creator>
      <dc:date>2011-03-30T22:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple values per key in one record</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70986#M17762</link>
      <description>&lt;P&gt;Sorry about the last title.  That was bad form.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2011 22:33:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70986#M17762</guid>
      <dc:creator>blurblebot</dc:creator>
      <dc:date>2011-03-30T22:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple values per key in one record</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70987#M17763</link>
      <description>&lt;P&gt;Blurblebot,&lt;/P&gt;

&lt;P&gt;You can do this via props/transforms like so.  The trick is to use MV_ADD &lt;A href="http://www.splunk.com/base/Documentation/latest/Admin/Transformsconf" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/Admin/Transformsconf&lt;/A&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;## props.conf
[&amp;lt;your_sourcetype&amp;gt;]
REPORT-name_for_your_sourcetype = name_for_your_sourcetype

## transforms.conf
[name_for_your_sourcetype]
REGEX = Name=(\S+)
FORMAT = name::$1
MV_ADD = True
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Mar 2011 22:50:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70987#M17763</guid>
      <dc:creator>hazekamp</dc:creator>
      <dc:date>2011-03-30T22:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple values per key in one record</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70988#M17764</link>
      <description>&lt;P&gt;You beat me to it!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2011 22:52:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70988#M17764</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2011-03-30T22:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple values per key in one record</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70989#M17765</link>
      <description>&lt;P&gt;Beauty.  Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2011 22:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70989#M17765</guid>
      <dc:creator>blurblebot</dc:creator>
      <dc:date>2011-03-30T22:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple values per key in one record</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70990#M17766</link>
      <description>&lt;P&gt;Small capitalization correction on your answer:&lt;/P&gt;

&lt;P&gt;FORMAT = Name::$1&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2011 17:36:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-values-per-key-in-one-record/m-p/70990#M17766</guid>
      <dc:creator>blurblebot</dc:creator>
      <dc:date>2011-08-12T17:36:57Z</dc:date>
    </item>
  </channel>
</rss>

