<?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: Merge two services from same index with common field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585978#M204129</link>
    <description>&lt;P&gt;that did not work .. can only see Name and RecordID fields... version is populated because it's able to see that name in the original serv1 .. version1 is null. To test the above I modified your reply to following&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (service=serv1 OR service=serv2)
| eval version2 = if(service=serv2, version, null())
| eval version1 = if(service=serv1, version, null())
| stats values(*) as * by RecordID
| table Name RecordID version1 version2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and now both version1 and version2 is empty..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also tried this with same results as above&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (service=serv1 OR service=serv2)
| eval version2 = case(service=serv2, version)
| eval version1 = case(service=serv1, version)
| stats values(*) as * by RecordID
| table Name RecordID version1 version2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to highlight.. End result I want is only values from Serv1, where there is a matching &lt;STRONG&gt;RecordID&lt;/STRONG&gt; in the Serv2.. The whole point of this exercise is I want to replace all values of &lt;STRONG&gt;version&lt;/STRONG&gt;&amp;nbsp;in the Serv1 with &lt;STRONG&gt;version&amp;nbsp;&lt;/STRONG&gt;values from Serv2 where there is a matching RecordID and discard the rest. Serv1 is major data source and Serv2 is minor.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Feb 2022 02:02:28 GMT</pubDate>
    <dc:creator>arunakalla</dc:creator>
    <dc:date>2022-02-22T02:02:28Z</dc:date>
    <item>
      <title>How to merge two services from same index with common field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585952#M204117</link>
      <description>&lt;P&gt;I wanted to join services (part of same index) with common field and show chosen fields from both searches..&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Index=test service=serv1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Name&lt;/P&gt;
&lt;P&gt;RecordID&lt;/P&gt;
&lt;P&gt;Version&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Index=test service=serv2&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;State&lt;/P&gt;
&lt;P&gt;RecordID&lt;/P&gt;
&lt;P&gt;Version&lt;/P&gt;
&lt;P&gt;wants to combine two searches by &lt;STRONG&gt;&lt;U&gt;RecordID&lt;/U&gt;&amp;nbsp;from Service2&amp;nbsp; (meaning to optimize query needs to first take RecordID from Service2 and match with Service1)...&amp;nbsp;&lt;/STRONG&gt;and notice fieldname &lt;STRONG&gt;Version&lt;/STRONG&gt; is common both services. so hence wants to rename version field in service2 to &lt;STRONG&gt;version2.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;And final result is&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Name Version1 V&lt;EM&gt;ersion2&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;SQL Query:&lt;/P&gt;
&lt;P&gt;Select A.Name, A.version, B.version&lt;/P&gt;
&lt;P&gt;from Service1 A, Service2 B&lt;/P&gt;
&lt;P&gt;where B.RecordID = A.RecordID&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 17:47:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585952#M204117</guid>
      <dc:creator>arunakalla</dc:creator>
      <dc:date>2022-02-23T17:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585953#M204118</link>
      <description>&lt;P&gt;I tried all help and&amp;nbsp; [used Join command and/or stats command] .. nothing worked for my case&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 18:26:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585953#M204118</guid>
      <dc:creator>arunakalla</dc:creator>
      <dc:date>2022-02-21T18:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585960#M204124</link>
      <description>&lt;P&gt;It would help to know what you've already tried so we don't suggest the same thing.&lt;/P&gt;&lt;P&gt;Since you appear to know SQL you might find this document helpful:&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SQLtoSplunk" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SQLtoSplunk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here's one way to do it&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test service=serv1
| join RecordID [ search index=test service=serv2 | rename version as version2 ]
| table Name RecordID version version2&lt;/LI-CODE&gt;&lt;P&gt;Here's another that doesn't use join.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (service=serv1 OR service=serv2)
```If Name is null then this is a serv2 event so set version2=version```
| eval version2 = if(isnull(Name), version, null())
| stats values(*) as * by RecordID
| table Name RecordID version version2&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Feb 2022 19:43:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585960#M204124</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-02-21T19:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585975#M204127</link>
      <description>&lt;P&gt;Just to highlight that &lt;U&gt;join&lt;/U&gt; is more expensive than &lt;U&gt;stats&lt;/U&gt;. &amp;nbsp;Meanwhile, the second method (no join) may need to remove original values of &lt;FONT face="courier new,courier"&gt;version&lt;/FONT&gt; from &lt;EM&gt;serv2&lt;/EM&gt; if &lt;FONT face="courier new,courier"&gt;version2&lt;/FONT&gt; has distinct values from those from &lt;EM&gt;serv1&lt;/EM&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (service=serv1 OR service=serv2)
| eval version2 = if(service=serv2, version, null())
| eval version = if(service=serv1, version, null())
| stats values(*) as * by RecordID
| table Name RecordID version version2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 00:05:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585975#M204127</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-22T00:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585978#M204129</link>
      <description>&lt;P&gt;that did not work .. can only see Name and RecordID fields... version is populated because it's able to see that name in the original serv1 .. version1 is null. To test the above I modified your reply to following&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (service=serv1 OR service=serv2)
| eval version2 = if(service=serv2, version, null())
| eval version1 = if(service=serv1, version, null())
| stats values(*) as * by RecordID
| table Name RecordID version1 version2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and now both version1 and version2 is empty..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also tried this with same results as above&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (service=serv1 OR service=serv2)
| eval version2 = case(service=serv2, version)
| eval version1 = case(service=serv1, version)
| stats values(*) as * by RecordID
| table Name RecordID version1 version2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to highlight.. End result I want is only values from Serv1, where there is a matching &lt;STRONG&gt;RecordID&lt;/STRONG&gt; in the Serv2.. The whole point of this exercise is I want to replace all values of &lt;STRONG&gt;version&lt;/STRONG&gt;&amp;nbsp;in the Serv1 with &lt;STRONG&gt;version&amp;nbsp;&lt;/STRONG&gt;values from Serv2 where there is a matching RecordID and discard the rest. Serv1 is major data source and Serv2 is minor.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 02:02:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585978#M204129</guid>
      <dc:creator>arunakalla</dc:creator>
      <dc:date>2022-02-22T02:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585979#M204130</link>
      <description>&lt;P&gt;Thanks for the reply first one worked.. Stats did not work.. I am not getting the&amp;nbsp; version2 values.. pls see my response to other reply below&lt;/P&gt;&lt;P&gt;Docs says join&amp;nbsp; only works for 50000 records and after some time it terminates.. hence wants needs to make stats work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 02:11:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585979#M204130</guid>
      <dc:creator>arunakalla</dc:creator>
      <dc:date>2022-02-22T02:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585992#M204134</link>
      <description>&lt;P&gt;My bad. &amp;nbsp;Literal values should be quoted when use in eval.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (service=serv1 OR service=serv2)
| eval version2 = if(service=="serv2", version, null())
| eval version1 = if(service=="serv1", version, null())
| stats values(*) as * by RecordID
| table Name RecordID version1 version2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 06:20:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/585992#M204134</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-22T06:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586044#M204143</link>
      <description>&lt;P&gt;This is acting like left join with difference.. so basically keeping all records of the &lt;STRONG&gt;version1&lt;/STRONG&gt; and inserting value of the &lt;STRONG&gt;version2&amp;nbsp;&lt;/STRONG&gt;into the &lt;STRONG&gt;version1 (now I can see old value of version1+version2) ,&amp;nbsp;&lt;/STRONG&gt;along with version2 value in it's column.&amp;nbsp; it looks like this&lt;/P&gt;&lt;P&gt;Serv1&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;RecordID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Version&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Name1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;^5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Name2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;5.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Name3&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;RecordID3&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;5.7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Serv2&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Place&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;RecordID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Version&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Pl1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;5.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Pl2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&amp;nbsp;5.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;Pl3&lt;/TD&gt;&lt;TD height="25px"&gt;RecordID7&lt;/TD&gt;&lt;TD height="25px"&gt;4.7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End Result&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Name&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;Vesrion1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;Version2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Name1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;P&gt;^5&lt;/P&gt;&lt;P&gt;5.5&lt;/P&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;5.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Name2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID2&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;5.5&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;5.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Name3&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID3&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;5.7&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 22 Feb 2022 14:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586044#M204143</guid>
      <dc:creator>arunakalla</dc:creator>
      <dc:date>2022-02-22T14:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586136#M204178</link>
      <description>&lt;P&gt;Did the previously revised search work?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 05:15:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586136#M204178</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-23T05:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586255#M204221</link>
      <description>&lt;P&gt;Yes, double quotes worked and hence the above issue..&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 15:19:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586255#M204221</guid>
      <dc:creator>arunakalla</dc:creator>
      <dc:date>2022-02-23T15:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586297#M204241</link>
      <description>&lt;P&gt;This is indeed very unexpected. &amp;nbsp;I suspect that your serv1 data already contain multiple Version values. &amp;nbsp;Could you examine data with this in the same period you tested the other search:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (service=serv1)
| eval Version2 = if(service=="serv2", Version, null())
| eval Version1 = if(service=="serv1", Version, null())
| stats values(*) as * by RecordID
| table Name RecordID Version1 Version2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I notice that you originally posted Version as capitalized, but my sample code used all lowercase "version". &amp;nbsp;I guess that you have corrected this in your tests.) In this test, there is no data from serv2. &amp;nbsp;Therefore, I expect this result&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Name&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;Vesrion1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;Version2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Name1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;P&gt;^5&lt;/P&gt;&lt;P&gt;5.5&lt;/P&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Name2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID2&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;5.5&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Name3&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;RecordID3&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;5.7&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;If the above is the case, the search is working as expected. &amp;nbsp;To replace Version with version2 where RecordID match in serv1 and serv2, just force it.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (service=serv1 OR service=serv2)
| eval version2 = if(service=="serv2", Version, null())
| eval Version = if(service=="serv1", Version, null())
| stats values(*) as * by RecordID
| eval Version = if(isnull(version2), Version, version2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 19:33:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586297#M204241</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-23T19:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586304#M204246</link>
      <description>&lt;P&gt;yes other search is fine, except that it's getting throttled/timed out&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 19:55:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586304#M204246</guid>
      <dc:creator>arunakalla</dc:creator>
      <dc:date>2022-02-23T19:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586328#M204257</link>
      <description>&lt;P&gt;I am confused. &amp;nbsp;Did you confirm that from serv1, Version1 gives the exact multiple values as if searching both serv1 and serv2?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 23:20:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586328#M204257</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-23T23:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586607#M204333</link>
      <description>&lt;P&gt;My requirement is not to merge Version2 and Version1 and display multiple values in Version1.. Merge two services then display only rows that matches RecordID in Version2. Instead&lt;/P&gt;&lt;P&gt;(1) It is displaying all values from Serv1&lt;/P&gt;&lt;P&gt;(2) Version1 is displaying merged values&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 14:26:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586607#M204333</guid>
      <dc:creator>arunakalla</dc:creator>
      <dc:date>2022-02-25T14:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586719#M204370</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243254"&gt;@arunakalla&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;My requirement is not to merge Version2 and Version1 and display multiple values in Version1.. Merge two services then display only rows that matches RecordID in Version2. Instead&lt;/P&gt;&lt;P&gt;(1) It is displaying all values from Serv1&lt;/P&gt;&lt;P&gt;(2) Version1 is displaying merged values&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;(The forum really mixed up response order:-) Sorry I didn't explain clearly. &amp;nbsp;I suspect that your data contains multiple values, or the output from the search will not be as illustrated in the final results. &amp;nbsp;Maybe one step at a time. &amp;nbsp;Can you confirm the output from serv1 alone:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test (service=serv1)
| eval Version2 = if(service=="serv2", Version, null())
| eval Version1 = if(service=="serv1", Version, null())
| stats values(*) as * by RecordID
| table Name RecordID Version1 Version2 service&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How does it look like? (Note this search includes nothing from serv2 unless service itself is also multivalued.) Then, substitute for serv2 in the first line to verify whether multiple values occur in serv2.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 19:51:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586719#M204370</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-26T19:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two services from same index with common field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586728#M204374</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    index=test (service=serv1 OR service=serv2)
    | eval Version2 = if(service=="serv2", Version, null())
    | eval Version1 = if(service=="serv1", Version, null())
    | stats values(*) as * by RecordID
    | table Name RecordID Version1 Version2
    | where isnotnull(Version2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the above achieved my expected result.. Thanks you for all your help&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Feb 2022 03:11:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-services-from-same-index-with-common-field/m-p/586728#M204374</guid>
      <dc:creator>arunakalla</dc:creator>
      <dc:date>2022-02-27T03:11:09Z</dc:date>
    </item>
  </channel>
</rss>

