<?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: How to replace field values received from one search result in one index with second search result in other index by comparing the values? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-replace-field-values-received-from-one-search-result-in/m-p/335403#M6892</link>
    <description>&lt;P&gt;I don't have Splunk at the moment are your requirements are not clear, but I would try to do something with multivalue fields and spath &lt;/P&gt;

&lt;P&gt;|search 1 ... | eval ip=mvcombine delim="," ip| map search="search 2 ... &lt;BR /&gt;
| eval IPDetails.Element2.Service.Consumer{0}.IP{}=mvindex($ip$,0), IPDetails.Element2.Service.Consumer{1}.IP{}=mvindex($ip$,5), IPDetails.Element1.Service.Consumer{0}.IP{}=mvindex($ip$,8)"&lt;/P&gt;</description>
    <pubDate>Fri, 09 Mar 2018 08:15:55 GMT</pubDate>
    <dc:creator>valiquet</dc:creator>
    <dc:date>2018-03-09T08:15:55Z</dc:date>
    <item>
      <title>How to replace field values received from one search result in one index with second search result in other index by comparing the values?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-replace-field-values-received-from-one-search-result-in/m-p/335402#M6891</link>
      <description>&lt;P&gt;Index 1 search result:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Provider         IP             Version         Count
Provider1       10.10.10.1      1.0             30
Provider1       10.10.10.2      1.0             40
Provider1       10.10.10.3      1.0             100
Provider2       10.10.10.2      1.0             50
Provider2       10.10.10.2      1.0             75
Provider2       10.10.10.6      1.0             81
Provider3       10.10.10.3      1.0             25
Provider3       10.10.10.3      1.0             92
Provider4       10.10.10.4      1.0             20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Index 2 search result:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;IPDetails&amp;gt;
   &amp;lt;Element1 Name="ABC"&amp;gt;
      &amp;lt;Service Version="1.0"&amp;gt;
         &amp;lt;Consumer EntityCode="Ent1"&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.1&amp;lt;/IP&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.2&amp;lt;/IP&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.3&amp;lt;/IP&amp;gt;
         &amp;lt;/Consumer&amp;gt;
         &amp;lt;Consumer EntityCode="Ent2"&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.4&amp;lt;/IP&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.5&amp;lt;/IP&amp;gt;
         &amp;lt;/Consumer&amp;gt;
      &amp;lt;/Service&amp;gt;
   &amp;lt;/Element1&amp;gt;
   &amp;lt;Element2 Name="DEF"&amp;gt;
      &amp;lt;Service Version="1.0"&amp;gt;
         &amp;lt;Consumer EntityCode="Ent1"&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.1&amp;lt;/IP&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.2&amp;lt;/IP&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.3&amp;lt;/IP&amp;gt;
         &amp;lt;/Consumer&amp;gt;
         &amp;lt;Consumer EntityCode="Ent3"&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.6&amp;lt;/IP&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.7&amp;lt;/IP&amp;gt;
            &amp;lt;IP&amp;gt;10.10.10.8&amp;lt;/IP&amp;gt;
         &amp;lt;/Consumer&amp;gt;
      &amp;lt;/Service&amp;gt;
   &amp;lt;/API&amp;gt;
&amp;lt;/APIDetails&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could anyone advise me on how to replace the value of all IPs in IP field with second index's Consumer EntityCode, for example,  "Ent1" should be replaced with  10.10.10.1 or 10.10.10.2 or 10.10.10.3, "Ent2" should be replaced with 10.10.10.4 or 10.10.10.5, "Ent3" should be replaced with 10.10.10.6 or 7 or 8?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 08:06:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-replace-field-values-received-from-one-search-result-in/m-p/335402#M6891</guid>
      <dc:creator>AdsicSplunk</dc:creator>
      <dc:date>2018-03-08T08:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace field values received from one search result in one index with second search result in other index by comparing the values?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-replace-field-values-received-from-one-search-result-in/m-p/335403#M6892</link>
      <description>&lt;P&gt;I don't have Splunk at the moment are your requirements are not clear, but I would try to do something with multivalue fields and spath &lt;/P&gt;

&lt;P&gt;|search 1 ... | eval ip=mvcombine delim="," ip| map search="search 2 ... &lt;BR /&gt;
| eval IPDetails.Element2.Service.Consumer{0}.IP{}=mvindex($ip$,0), IPDetails.Element2.Service.Consumer{1}.IP{}=mvindex($ip$,5), IPDetails.Element1.Service.Consumer{0}.IP{}=mvindex($ip$,8)"&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 08:15:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-replace-field-values-received-from-one-search-result-in/m-p/335403#M6892</guid>
      <dc:creator>valiquet</dc:creator>
      <dc:date>2018-03-09T08:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace field values received from one search result in one index with second search result in other index by comparing the values?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-replace-field-values-received-from-one-search-result-in/m-p/335404#M6893</link>
      <description>&lt;P&gt;Thanks @valiquet  but I got my query resolved by creating and using csv lookup.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 05:54:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-replace-field-values-received-from-one-search-result-in/m-p/335404#M6893</guid>
      <dc:creator>AdsicSplunk</dc:creator>
      <dc:date>2018-03-14T05:54:12Z</dc:date>
    </item>
  </channel>
</rss>

