<?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: Getting a comma separate string from values function within stats command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73690#M18471</link>
    <description>&lt;P&gt;I downvoted this post because doesn't work&lt;/P&gt;</description>
    <pubDate>Thu, 27 Apr 2017 13:41:12 GMT</pubDate>
    <dc:creator>raoul</dc:creator>
    <dc:date>2017-04-27T13:41:12Z</dc:date>
    <item>
      <title>Getting a comma separate string from values function within stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73687#M18468</link>
      <description>&lt;P&gt;When I extract the list of values of a field in stats command, the values appear in separate lines making the output sparse and ugly.  Is it possible to get the values as a comma separated string so that everything sits in one line?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2012 22:57:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73687#M18468</guid>
      <dc:creator>ramesh</dc:creator>
      <dc:date>2012-06-12T22:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a comma separate string from values function within stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73688#M18469</link>
      <description>&lt;P&gt;You could do this by using the makemv command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere | 
stats values(myField) as myFieldValues by field2 |
makemv delim="," myFieldValues
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Jun 2012 23:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73688#M18469</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-06-18T23:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a comma separate string from values function within stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73689#M18470</link>
      <description>&lt;P&gt;Actually, this just doesn't work. At any rate when I run such a query I do NOT get the values separated by commas.&lt;/P&gt;

&lt;P&gt;Nor would one expect it to based on the documentation of the &lt;CODE&gt;makemv&lt;/CODE&gt; command which says: &lt;EM&gt;Converts a single valued field into a multivalue field by splitting it on a simple string delimiter&lt;/EM&gt;. &lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2017 13:40:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73689#M18470</guid>
      <dc:creator>raoul</dc:creator>
      <dc:date>2017-04-27T13:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a comma separate string from values function within stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73690#M18471</link>
      <description>&lt;P&gt;I downvoted this post because doesn't work&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2017 13:41:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73690#M18471</guid>
      <dc:creator>raoul</dc:creator>
      <dc:date>2017-04-27T13:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a comma separate string from values function within stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73691#M18472</link>
      <description>&lt;P&gt;What you need is to use &lt;CODE&gt;eval&lt;/CODE&gt; and then the &lt;CODE&gt;mvjoin()&lt;/CODE&gt; function. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere |
stats values(myField) as myFieldValues by field2 |
eval myFieldValues=mvjoin(myFieldValues, ", ")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Apr 2017 13:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73691#M18472</guid>
      <dc:creator>raoul</dc:creator>
      <dc:date>2017-04-27T13:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a comma separate string from values function within stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73692#M18473</link>
      <description>&lt;P&gt;You are right, my apologies. &lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 01:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73692#M18473</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-05-02T01:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a comma separate string from values function within stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73693#M18474</link>
      <description>&lt;P&gt;Yup that one works as intended! Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 12:29:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/73693#M18474</guid>
      <dc:creator>duartet</dc:creator>
      <dc:date>2020-02-28T12:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a comma separate string from values function within stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/526550#M148611</link>
      <description>&lt;P&gt;Works for me in Splunk 8.0.2, but now I need to add a wildcard prefix and quotes to each value.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 23:11:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-a-comma-separate-string-from-values-function-within/m-p/526550#M148611</guid>
      <dc:creator>justdan23</dc:creator>
      <dc:date>2020-10-26T23:11:05Z</dc:date>
    </item>
  </channel>
</rss>

