<?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: mvcombine ignores specified delimiter in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126268#M25987</link>
    <description>&lt;P&gt;This guy has the right answer here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/242855/mvcombine-ignores-specified-delimiter-1.html"&gt;https://answers.splunk.com/answers/242855/mvcombine-ignores-specified-delimiter-1.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In short, your search needs to move the delim parameter to your stats command, like this.&lt;/P&gt;

&lt;P&gt;source=/var/log/secure "pam_unix(sshd:session): session opened" | stats delim="," values(user) as "user" by host |  mvcombine user&lt;/P&gt;</description>
    <pubDate>Thu, 29 Oct 2015 14:35:51 GMT</pubDate>
    <dc:creator>peter7431</dc:creator>
    <dc:date>2015-10-29T14:35:51Z</dc:date>
    <item>
      <title>mvcombine ignores specified delimiter</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126265#M25984</link>
      <description>&lt;P&gt;We're indexing /var/log/secure, as one does, and I have a request to list users who've logged in in a comma-delimted list per host.  I'm using the Splunk search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/var/log/secure "pam_unix(sshd:session): session opened" | stats values(user) as "user" by host |  mvcombine delim="," user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works great, but for some reason the results are not honoring the &lt;STRONG&gt;delim=","&lt;/STRONG&gt; and so they're coming out as space-delimited instead.  A minor annoyance, but pointers for getting this to do exactly as I want would be great.&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2015 19:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126265#M25984</guid>
      <dc:creator>mcomfurf</dc:creator>
      <dc:date>2015-05-22T19:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: mvcombine ignores specified delimiter</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126266#M25985</link>
      <description>&lt;P&gt;What are you trying to do with &lt;CODE&gt;mvcombine&lt;/CODE&gt; here?  It looks like your stats command is requesting a multivalue field for user, but then you're trying to combine it.  &lt;CODE&gt;mvcombine&lt;/CODE&gt; works on multiple events, with single-value fields. &lt;/P&gt;

&lt;P&gt;What do you want as your ultimate table?&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2015 02:52:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126266#M25985</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2015-05-23T02:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: mvcombine ignores specified delimiter</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126267#M25986</link>
      <description>&lt;P&gt;I want a table like so:&lt;/P&gt;

&lt;P&gt;host 1  user1,user4,user8,user13&lt;BR /&gt;
host2   user1,user2,user9,user11,user101&lt;BR /&gt;
host3   user2,user4,user10&lt;/P&gt;

&lt;P&gt;What I'm getting now is:&lt;/P&gt;

&lt;P&gt;host 1  user1 user4 user8 user13&lt;BR /&gt;
host2   user1 user2 user9 user11 user101&lt;BR /&gt;
host3   user2 user4 user10&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2015 18:00:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126267#M25986</guid>
      <dc:creator>mcomfurf</dc:creator>
      <dc:date>2015-05-26T18:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: mvcombine ignores specified delimiter</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126268#M25987</link>
      <description>&lt;P&gt;This guy has the right answer here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/242855/mvcombine-ignores-specified-delimiter-1.html"&gt;https://answers.splunk.com/answers/242855/mvcombine-ignores-specified-delimiter-1.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In short, your search needs to move the delim parameter to your stats command, like this.&lt;/P&gt;

&lt;P&gt;source=/var/log/secure "pam_unix(sshd:session): session opened" | stats delim="," values(user) as "user" by host |  mvcombine user&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 14:35:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126268#M25987</guid>
      <dc:creator>peter7431</dc:creator>
      <dc:date>2015-10-29T14:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: mvcombine ignores specified delimiter</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126269#M25988</link>
      <description>&lt;P&gt;In this case, @peter7431's answer is probably the best answer.  There are times when you aren't using stats to get the multi-value field so I wanted to follow-up with why it didn't work and two ways to make it work.&lt;/P&gt;

&lt;H3&gt;Why didn't it work?&lt;/H3&gt;

&lt;P&gt;mvcombine takes fields from different events and combines them.  For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 
| eval foo="cat;bear;monkey;horse;dog" 
| fields foo | eval foo=split(foo,";")
|  mvexpand foo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then if we try mvcombine and use nomv, you can see the effect of the delim argument:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[...]
| mvcombine delim="DelimsROCK" foo
|  nomv foo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;H3&gt;Other than the stats command, how can we make it work?&lt;/H3&gt;

&lt;H4&gt;Option 1: Utilize &lt;CODE&gt;mvexpand&lt;/CODE&gt; and &lt;CODE&gt;nomv&lt;/CODE&gt;&lt;/H4&gt;

&lt;P&gt;The most obvious solution can be seen in my above example where I use mvexpand foo and nomv foo:&lt;BR /&gt;
    source=/var/log/secure "pam_unix(sshd:session): session opened"&lt;BR /&gt;
    | stats values(user) as "user" by host &lt;BR /&gt;
    | mvexpand user&lt;BR /&gt;
    |  mvcombine delim="," user&lt;BR /&gt;
    | nomv user&lt;/P&gt;

&lt;P&gt;Note: There are two additions &lt;CODE&gt;mvexpand&lt;/CODE&gt; and &lt;CODE&gt;nomv&lt;/CODE&gt; &lt;/P&gt;

&lt;H4&gt;Option 2 (preferred): Use the &lt;CODE&gt;mvjoin&lt;/CODE&gt;&lt;/H4&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/var/log/secure "pam_unix(sshd:session): session opened"
| stats values(user) as "user" by host 
| eval user=mvjoin(user,",")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Jan 2017 17:10:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/mvcombine-ignores-specified-delimiter/m-p/126269#M25988</guid>
      <dc:creator>triest</dc:creator>
      <dc:date>2017-01-30T17:10:06Z</dc:date>
    </item>
  </channel>
</rss>

