<?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: Is there a function that concatenates result lines of strings? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-function-that-concatenates-result-lines-of-strings/m-p/310282#M165536</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;
you have to use mvcombine and nomv, something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
| head 100 
| dedup source  
| table source 
| mvcombine delim=", " source 
| nomv source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 18 Oct 2017 11:36:20 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-10-18T11:36:20Z</dc:date>
    <item>
      <title>Is there a function that concatenates result lines of strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-function-that-concatenates-result-lines-of-strings/m-p/310281#M165535</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;

&lt;P&gt;I would like to format a result into a string and I don't even know where to start and if there even is a function for that ...&lt;/P&gt;

&lt;P&gt;My results are a simple list of number/characters:&lt;/P&gt;

&lt;P&gt;AD1234&lt;BR /&gt;
AB2342&lt;BR /&gt;
GD4787&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;What I would like to have is a formatted string like this:&lt;/P&gt;

&lt;P&gt;("AD1234","AB2342","GD4787","...")&lt;/P&gt;

&lt;P&gt;Is there a function that concatenates result lines?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 09:12:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-function-that-concatenates-result-lines-of-strings/m-p/310281#M165535</guid>
      <dc:creator>koljalauterbach</dc:creator>
      <dc:date>2017-10-18T09:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that concatenates result lines of strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-function-that-concatenates-result-lines-of-strings/m-p/310282#M165536</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
you have to use mvcombine and nomv, something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
| head 100 
| dedup source  
| table source 
| mvcombine delim=", " source 
| nomv source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 11:36:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-function-that-concatenates-result-lines-of-strings/m-p/310282#M165536</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-10-18T11:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that concatenates result lines of strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-function-that-concatenates-result-lines-of-strings/m-p/310283#M165537</link>
      <description>&lt;P&gt;Try something like this to add the double quotes and parentheses around the string..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
|mvcombine delim="\",\"" field_name
|nomv data
|rex field=field_name mode=sed "s/(.*)/(\"\1\")/"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the function &lt;CODE&gt;|format&lt;/CODE&gt; will format a series like &lt;CODE&gt;(field=value1) OR (field=value2) OR ....&lt;/CODE&gt; but also works with more complex solutions, also, like when there is more than one field. &lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/Format"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/Format&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 11:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-function-that-concatenates-result-lines-of-strings/m-p/310283#M165537</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-18T11:56:33Z</dc:date>
    </item>
  </channel>
</rss>

