<?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 Clarification on Combining values of two fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Clarification-on-Combining-values-of-two-fields/m-p/153365#M185615</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;There are two columns named Filename and Directory and I want to combine the values of the above said fields and display it as a single field.&lt;/P&gt;

&lt;P&gt;Filename    Directory     File&lt;/P&gt;

&lt;P&gt;abc         /tmp/op      /tmp/op abc&lt;/P&gt;

&lt;P&gt;Method 1:&lt;BR /&gt;
I used mvappend command to combine like eval File=mvappend(Directory,Filename) ,the result is as follows&lt;/P&gt;

&lt;P&gt;Filename    Directory     File&lt;/P&gt;

&lt;P&gt;abc         /tmp/op      /tmp/op &lt;BR /&gt;
                               abc&lt;/P&gt;

&lt;P&gt;dxr         /tmp/in      /tmp/in&lt;BR /&gt;
                               dxr&lt;/P&gt;

&lt;P&gt;Method 2:&lt;/P&gt;

&lt;P&gt;I used eval File=Directory."".Filename .the result is as follows&lt;/P&gt;

&lt;P&gt;Filename    Directory     File&lt;/P&gt;

&lt;P&gt;abc         /tmp/op      /tmp/op abc &lt;/P&gt;

&lt;P&gt;dxr         /tmp/in      /tmp/in dxr&lt;/P&gt;

&lt;P&gt;Can you tell the reason on why mvappend command display the two values one below the other on combining also which method is efficient to use among the two methods mentioned above&lt;/P&gt;</description>
    <pubDate>Tue, 06 May 2014 07:00:04 GMT</pubDate>
    <dc:creator>Jananee_iNautix</dc:creator>
    <dc:date>2014-05-06T07:00:04Z</dc:date>
    <item>
      <title>Clarification on Combining values of two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Clarification-on-Combining-values-of-two-fields/m-p/153365#M185615</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;There are two columns named Filename and Directory and I want to combine the values of the above said fields and display it as a single field.&lt;/P&gt;

&lt;P&gt;Filename    Directory     File&lt;/P&gt;

&lt;P&gt;abc         /tmp/op      /tmp/op abc&lt;/P&gt;

&lt;P&gt;Method 1:&lt;BR /&gt;
I used mvappend command to combine like eval File=mvappend(Directory,Filename) ,the result is as follows&lt;/P&gt;

&lt;P&gt;Filename    Directory     File&lt;/P&gt;

&lt;P&gt;abc         /tmp/op      /tmp/op &lt;BR /&gt;
                               abc&lt;/P&gt;

&lt;P&gt;dxr         /tmp/in      /tmp/in&lt;BR /&gt;
                               dxr&lt;/P&gt;

&lt;P&gt;Method 2:&lt;/P&gt;

&lt;P&gt;I used eval File=Directory."".Filename .the result is as follows&lt;/P&gt;

&lt;P&gt;Filename    Directory     File&lt;/P&gt;

&lt;P&gt;abc         /tmp/op      /tmp/op abc &lt;/P&gt;

&lt;P&gt;dxr         /tmp/in      /tmp/in dxr&lt;/P&gt;

&lt;P&gt;Can you tell the reason on why mvappend command display the two values one below the other on combining also which method is efficient to use among the two methods mentioned above&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2014 07:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Clarification-on-Combining-values-of-two-fields/m-p/153365#M185615</guid>
      <dc:creator>Jananee_iNautix</dc:creator>
      <dc:date>2014-05-06T07:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification on Combining values of two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Clarification-on-Combining-values-of-two-fields/m-p/153366#M185616</link>
      <description>&lt;P&gt;Hi Jananee_iNautix,&lt;/P&gt;

&lt;P&gt;Method 1 creates a new multivalued field containing &lt;CODE&gt;/tmp/op&lt;/CODE&gt; and &lt;CODE&gt;abc&lt;/CODE&gt; as value.&lt;BR /&gt;
Method 2 creates a new singlevalued field containing &lt;CODE&gt;/tmp/op abc&lt;/CODE&gt; as value.&lt;/P&gt;

&lt;P&gt;Take this run everywhere example and see that in &lt;CODE&gt;my_count&lt;/CODE&gt; the values is 2 as there are two values in the field &lt;CODE&gt;my&lt;/CODE&gt; where as in field &lt;CODE&gt;yours&lt;/CODE&gt; the count is only 1 value&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | head 1 | eval foo="1" | eval boo="2" | eval my=mvappend(foo, boo) | eval yours=foo." ".boo | eval my_count=mvcount(my) | eval yours_count=mvcount(yours) | table foo boo my my_count yours yours_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2014 07:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Clarification-on-Combining-values-of-two-fields/m-p/153366#M185616</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-06T07:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification on Combining values of two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Clarification-on-Combining-values-of-two-fields/m-p/153367#M185617</link>
      <description>&lt;P&gt;Can you tell which among the two methods is efficient?&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2014 13:36:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Clarification-on-Combining-values-of-two-fields/m-p/153367#M185617</guid>
      <dc:creator>Jananee_iNautix</dc:creator>
      <dc:date>2014-05-06T13:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Clarification on Combining values of two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Clarification-on-Combining-values-of-two-fields/m-p/153368#M185618</link>
      <description>&lt;P&gt;No, this depends on your use case and what you further do with the new field. You can test it very easy: run both searches and compare the run times in the job inspector.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2014 13:39:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Clarification-on-Combining-values-of-two-fields/m-p/153368#M185618</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-06T13:39:32Z</dc:date>
    </item>
  </channel>
</rss>

