<?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 Value list in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Value-list/m-p/381213#M111523</link>
    <description>&lt;P&gt;Hi Everyone, I'm sure there are similar queries out there and I have searched however I am still struggling to find a simple answer to this problem.&lt;/P&gt;

&lt;P&gt;My query currently is structured like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=hosts "Failed password for " NOT "Failed password for invalid"  
| rex "Failed\spassword\sfor\s(?&amp;lt;username&amp;gt;.*)\sfrom\s(?&amp;lt;source_ip&amp;gt;\d+.\d+.\d+.\d+)\sport\s(?&amp;lt;port&amp;gt;\d+)\s(?&amp;lt;protocol&amp;gt;.*)" 
| stats count as "Failed Attempts" by source_ip,host,username,
| sort - "Failed Attempts" 
| head 20
| table source_ip,host,"Failed Attempts"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And returns data that looks like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source_ip     host                 Failed Attempts
IP.IP.IP.IP hostname1@domain.com     3
IP.IP.IP.IP hostname2@domain.com     2
IP.IP.IP.IP    hostname3@domain.com     #Count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And what I'd like to achieve is a multi-value list associated with each host as to what username was used&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source_ip     host                 Failed Attempts      Username
IP.IP.IP.IP hostname@domain.com 3                     root
                                                            admin
                                                            puppet
IP.IP.IP.IP hostname@domain.com    2                     root
                                                            username1
IP.IP.IP.IP    hostname@domain.com  #Count                #ListOfNames
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any assistance would be greatly appreciated, I've tried transactions, values, and even eval statements and can't find how to display this information cleanly.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Feb 2019 11:50:28 GMT</pubDate>
    <dc:creator>montydo</dc:creator>
    <dc:date>2019-02-13T11:50:28Z</dc:date>
    <item>
      <title>Value list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Value-list/m-p/381213#M111523</link>
      <description>&lt;P&gt;Hi Everyone, I'm sure there are similar queries out there and I have searched however I am still struggling to find a simple answer to this problem.&lt;/P&gt;

&lt;P&gt;My query currently is structured like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=hosts "Failed password for " NOT "Failed password for invalid"  
| rex "Failed\spassword\sfor\s(?&amp;lt;username&amp;gt;.*)\sfrom\s(?&amp;lt;source_ip&amp;gt;\d+.\d+.\d+.\d+)\sport\s(?&amp;lt;port&amp;gt;\d+)\s(?&amp;lt;protocol&amp;gt;.*)" 
| stats count as "Failed Attempts" by source_ip,host,username,
| sort - "Failed Attempts" 
| head 20
| table source_ip,host,"Failed Attempts"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And returns data that looks like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source_ip     host                 Failed Attempts
IP.IP.IP.IP hostname1@domain.com     3
IP.IP.IP.IP hostname2@domain.com     2
IP.IP.IP.IP    hostname3@domain.com     #Count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And what I'd like to achieve is a multi-value list associated with each host as to what username was used&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source_ip     host                 Failed Attempts      Username
IP.IP.IP.IP hostname@domain.com 3                     root
                                                            admin
                                                            puppet
IP.IP.IP.IP hostname@domain.com    2                     root
                                                            username1
IP.IP.IP.IP    hostname@domain.com  #Count                #ListOfNames
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any assistance would be greatly appreciated, I've tried transactions, values, and even eval statements and can't find how to display this information cleanly.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 11:50:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Value-list/m-p/381213#M111523</guid>
      <dc:creator>montydo</dc:creator>
      <dc:date>2019-02-13T11:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Value list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Value-list/m-p/381214#M111524</link>
      <description>&lt;P&gt;This should do it...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=hosts "Failed password for " NOT "Failed password for invalid"  
| rex "Failed\spassword\sfor\s(?&amp;lt;username&amp;gt;.*)\sfrom\s(?&amp;lt;source_ip&amp;gt;\d+.\d+.\d+.\d+)\sport\s(?&amp;lt;port&amp;gt;\d+)\s(?&amp;lt;protocol&amp;gt;.*)" 
| stats count as "Failed Attempts", values(username) as Username by source_ip,host
| sort - "Failed Attempts" 
| head 20
| table source_ip,host,"Failed Attempts", Username
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Feb 2019 12:02:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Value-list/m-p/381214#M111524</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-02-13T12:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Value list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Value-list/m-p/381215#M111525</link>
      <description>&lt;P&gt;I can't believe it was that simple, I don't know how I missed it.&lt;/P&gt;

&lt;P&gt;As a slight extension to this answer would it be possible to have a multi-value list for the IP's as well? &lt;/P&gt;

&lt;P&gt;That way I'll have what I've described above, as at the moment I get duplicated hostnames because the IP fields are all different.&lt;/P&gt;

&lt;P&gt;It would be nice to have all the IP's grouped in a multi-value style BY hostname, and then all usernames that were attempted (also as a multi-value list as you've achieved in your answer)&lt;/P&gt;

&lt;P&gt;Many thanks though&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 13:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Value-list/m-p/381215#M111525</guid>
      <dc:creator>montydo</dc:creator>
      <dc:date>2019-02-13T13:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Value list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Value-list/m-p/381216#M111526</link>
      <description>&lt;P&gt;Sure thing ...&lt;/P&gt;

&lt;P&gt;If you replace line 3 with &lt;CODE&gt;| stats count as "Failed Attempts", values(username) as Username, values(source_ip) as source_ip by host&lt;/CODE&gt; you will have your desired result.&lt;/P&gt;

&lt;P&gt;Could you please mark the answer as accepted and close the question if this helped you?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 13:27:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Value-list/m-p/381216#M111526</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-02-13T13:27:37Z</dc:date>
    </item>
  </channel>
</rss>

