<?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: How to make list(x) include all values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-list-x-include-all-values/m-p/369284#M108795</link>
    <description>&lt;P&gt;Hi @jpayne1&lt;/P&gt;

&lt;P&gt;Can you please try below search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
| rex field=Names ".*(?&amp;lt;Flag&amp;gt;Bill).*" 
| fillnull value=" " Flag
| eval tempField= mvzip(mvzip(Flag,names),Address) 
| stats count by tempField
| eval Flag = mvindex(split(tempField,","),0), names= mvindex(split(tempField,","),1), Address=mvindex(split(tempField,","),2) 
| table Address Flag Names
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2017 05:21:20 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2017-11-14T05:21:20Z</dc:date>
    <item>
      <title>How to make list(x) include all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-list-x-include-all-values/m-p/369282#M108793</link>
      <description>&lt;P&gt;list(x) does not return all values. If I have white space as my value, list omits it. Here is a simplified example of my use case:&lt;/P&gt;

&lt;P&gt;Desired output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     Address    Flag       Names
     ----------------------------
     IP1                 Jack Jill
     IP2                 Todd Tammy
     IP3        Bill     Bill Bob
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Partial code snippet:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
| rex field=Names ".*(?&amp;lt;Flag&amp;gt;Bill).*" 
| fillnull value=" " Flag
| stats list(Flag) list(names) by Address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I'm getting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     Address    Flag       Names
     ----------------------------
     IP1        Bill      Jack Jill
     IP2                  Todd Tammy
     IP3                  Bill Bob
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried using a fillnull value of 0, running the list command, then replacing the 0 with " ", but this still doesn't preserve the order. The value Bill shoots back up to the first line as soon as I replace the zeros.&lt;/P&gt;

&lt;P&gt;I'm currently using a table instead, but this adds a lot more rows and is not as easy to read, especially if an IP has many records. I could change fillvalue to a non-whitespace character, but that would look a bit sloppy to the end user, although it is better than resorting to table.&lt;/P&gt;

&lt;P&gt;Has anyone else dealt with this? Should I be going at this a completely different way than list? &lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 01:43:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-list-x-include-all-values/m-p/369282#M108793</guid>
      <dc:creator>jpayne1</dc:creator>
      <dc:date>2017-11-14T01:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to make list(x) include all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-list-x-include-all-values/m-p/369283#M108794</link>
      <description>&lt;P&gt;@jpayne1, try the following &lt;CODE&gt;searchmatch()&lt;/CODE&gt; command instead of &lt;CODE&gt;rex&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;YourBaseSearch&amp;gt;
|  eval Flag=if(searchmatch("\&amp;lt;Flag\&amp;gt;Bill"),"Bill","NA")
|  stats list(Flag) as Flag list(names) as Names by Address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can your data have multiple values of Flag and Names for same IP Addresses? Can you please share the data for IP1, IP2 and IP3? Specially the &lt;CODE&gt;&amp;lt;Flag&amp;gt;&lt;/CODE&gt; portion of the code as to what it looks like when the value is not &lt;CODE&gt;Bill&lt;/CODE&gt;? You can mock anonymize data if required.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 02:08:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-list-x-include-all-values/m-p/369283#M108794</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-14T02:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to make list(x) include all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-list-x-include-all-values/m-p/369284#M108795</link>
      <description>&lt;P&gt;Hi @jpayne1&lt;/P&gt;

&lt;P&gt;Can you please try below search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
| rex field=Names ".*(?&amp;lt;Flag&amp;gt;Bill).*" 
| fillnull value=" " Flag
| eval tempField= mvzip(mvzip(Flag,names),Address) 
| stats count by tempField
| eval Flag = mvindex(split(tempField,","),0), names= mvindex(split(tempField,","),1), Address=mvindex(split(tempField,","),2) 
| table Address Flag Names
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 05:21:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-list-x-include-all-values/m-p/369284#M108795</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-11-14T05:21:20Z</dc:date>
    </item>
  </channel>
</rss>

