<?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 mvcombine removes timestamp in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/mvcombine-removes-timestamp/m-p/34012#M7264</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am doing a query, where I get a multi valued field and I need to append something to each value depending what the value is.  I can't find a way to apply a statement to the multiple values, the only thing I can think to do is to expand the field make my change and recombine it.  However, when I recombine it, the timestamp _time loses its content and this is a field we need.&lt;/P&gt;

&lt;P&gt;The command is:&lt;/P&gt;

&lt;PRE&gt;
host=glon19u10329 index="DTS" sourcetype="config" | xpath "//value/with/cfg/serverUrl" outfield=emsName | mvexpand emsName | eval status = if(match(emsName,"tcp://ems-dit*"),"Tier 2", if(match(emsName,"tcp://vsol43a-7801*"), "Tier 2", if(match(emsName, "tcp://vsgl43a-2016*"), "Tier 2", if(match(emsName,"tcp://vhbl31a04103*"), "Tier 2", "Tier 3")))) | strcat emsName ":" status emsName | mvcombine emsName
&lt;/PRE&gt;

&lt;P&gt;Before applying the mvcombine, the time stamp shows correctly.  &lt;/P&gt;

&lt;P&gt;Example&lt;/P&gt;

&lt;PRE&gt;
BEFORE:
_time     emsName
19/08/2010 09:00     tcp://ems-dit-eu-uat-1: Tier 2
19/08/2010 09:00     tcp://emsuatdata: Tier 3
....

AFTER (as one event)
_time     emsName
          tcp://ems-dit-eu-uat-1: Tier 2
          tcp://emsuatdata: Tier 3
&lt;/PRE&gt;

&lt;P&gt;Any idea why the _time field doesn't make it through the mvcombine?&lt;/P&gt;

&lt;P&gt;Thanks
Hazel&lt;/P&gt;</description>
    <pubDate>Fri, 20 Aug 2010 17:48:18 GMT</pubDate>
    <dc:creator>Hazel</dc:creator>
    <dc:date>2010-08-20T17:48:18Z</dc:date>
    <item>
      <title>mvcombine removes timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/mvcombine-removes-timestamp/m-p/34012#M7264</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am doing a query, where I get a multi valued field and I need to append something to each value depending what the value is.  I can't find a way to apply a statement to the multiple values, the only thing I can think to do is to expand the field make my change and recombine it.  However, when I recombine it, the timestamp _time loses its content and this is a field we need.&lt;/P&gt;

&lt;P&gt;The command is:&lt;/P&gt;

&lt;PRE&gt;
host=glon19u10329 index="DTS" sourcetype="config" | xpath "//value/with/cfg/serverUrl" outfield=emsName | mvexpand emsName | eval status = if(match(emsName,"tcp://ems-dit*"),"Tier 2", if(match(emsName,"tcp://vsol43a-7801*"), "Tier 2", if(match(emsName, "tcp://vsgl43a-2016*"), "Tier 2", if(match(emsName,"tcp://vhbl31a04103*"), "Tier 2", "Tier 3")))) | strcat emsName ":" status emsName | mvcombine emsName
&lt;/PRE&gt;

&lt;P&gt;Before applying the mvcombine, the time stamp shows correctly.  &lt;/P&gt;

&lt;P&gt;Example&lt;/P&gt;

&lt;PRE&gt;
BEFORE:
_time     emsName
19/08/2010 09:00     tcp://ems-dit-eu-uat-1: Tier 2
19/08/2010 09:00     tcp://emsuatdata: Tier 3
....

AFTER (as one event)
_time     emsName
          tcp://ems-dit-eu-uat-1: Tier 2
          tcp://emsuatdata: Tier 3
&lt;/PRE&gt;

&lt;P&gt;Any idea why the _time field doesn't make it through the mvcombine?&lt;/P&gt;

&lt;P&gt;Thanks
Hazel&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2010 17:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/mvcombine-removes-timestamp/m-p/34012#M7264</guid>
      <dc:creator>Hazel</dc:creator>
      <dc:date>2010-08-20T17:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: mvcombine removes timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/mvcombine-removes-timestamp/m-p/34013#M7265</link>
      <description>&lt;P&gt;That's weird.  Have you tried renaming &lt;CODE&gt;_time&lt;/CODE&gt; before your &lt;CODE&gt;mvepand&lt;/CODE&gt; and then rename it back after &lt;CODE&gt;mvcombine&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=glon19u10329 index="DTS" sourcetype="config" | xpath "//value/with/cfg/serverUrl" outfield=emsName | rename _time as keep_time | mvexpand emsName | eval status = if(match(emsName,"tcp://ems-dit*"),"Tier 2", if(match(emsName,"tcp://vsol43a-7801*"), "Tier 2", if(match(emsName, "tcp://vsgl43a-2016*"), "Tier 2", if(match(emsName,"tcp://vhbl31a04103*"), "Tier 2", "Tier 3")))) | strcat emsName ":" status emsName | mvcombine emsName | rename keep_time as _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Not sure if this will work or not.  I know that sometimes &lt;CODE&gt;_*&lt;/CODE&gt; fields get handled differently so perhaps this trick will get past that.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2010 20:24:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/mvcombine-removes-timestamp/m-p/34013#M7265</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-08-20T20:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: mvcombine removes timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/mvcombine-removes-timestamp/m-p/34014#M7266</link>
      <description>&lt;P&gt;thanks this works as a workaround.  Would be interested to know if this is the intended behaviour for the _time field though!&lt;/P&gt;</description>
      <pubDate>Sat, 21 Aug 2010 00:35:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/mvcombine-removes-timestamp/m-p/34014#M7266</guid>
      <dc:creator>Hazel</dc:creator>
      <dc:date>2010-08-21T00:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: mvcombine removes timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/mvcombine-removes-timestamp/m-p/34015#M7267</link>
      <description>&lt;P&gt;Yes, it is intended behavior.  As a rule, we don't use any _* fields in mvcombine.  This is because you may often see events that differ only in internal fields that are not shown (i.e. _cd), and then wonder why they weren't combined.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Aug 2010 01:11:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/mvcombine-removes-timestamp/m-p/34015#M7267</guid>
      <dc:creator>steveyz</dc:creator>
      <dc:date>2010-08-21T01:11:15Z</dc:date>
    </item>
  </channel>
</rss>

