<?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 How do I get the value of one field if the value of another field matches? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-value-of-one-field-if-the-value-of-another/m-p/187790#M54128</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have 2 data logs "datasource1" and "datasource2", under same sourcetype name="DATALOGS", for e.g.&lt;/P&gt;

&lt;P&gt;datasource1&lt;/P&gt;

&lt;P&gt;variable1=111&lt;/P&gt;

&lt;P&gt;variable2= 222&lt;/P&gt;

&lt;P&gt;variable3= 333&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;datasource2&lt;/P&gt;

&lt;P&gt;variable1=aaa&lt;/P&gt;

&lt;P&gt;variable2= bbb&lt;/P&gt;

&lt;P&gt;variable3= ccc&lt;/P&gt;

&lt;P&gt;Now i want to get the value of variable1, if and only if variable2 value matches "123".&lt;/P&gt;

&lt;P&gt;How to do this. Please Help...!!!&lt;/P&gt;</description>
    <pubDate>Sun, 22 Dec 2013 19:25:26 GMT</pubDate>
    <dc:creator>harshal_chakran</dc:creator>
    <dc:date>2013-12-22T19:25:26Z</dc:date>
    <item>
      <title>How do I get the value of one field if the value of another field matches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-value-of-one-field-if-the-value-of-another/m-p/187790#M54128</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have 2 data logs "datasource1" and "datasource2", under same sourcetype name="DATALOGS", for e.g.&lt;/P&gt;

&lt;P&gt;datasource1&lt;/P&gt;

&lt;P&gt;variable1=111&lt;/P&gt;

&lt;P&gt;variable2= 222&lt;/P&gt;

&lt;P&gt;variable3= 333&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;datasource2&lt;/P&gt;

&lt;P&gt;variable1=aaa&lt;/P&gt;

&lt;P&gt;variable2= bbb&lt;/P&gt;

&lt;P&gt;variable3= ccc&lt;/P&gt;

&lt;P&gt;Now i want to get the value of variable1, if and only if variable2 value matches "123".&lt;/P&gt;

&lt;P&gt;How to do this. Please Help...!!!&lt;/P&gt;</description>
      <pubDate>Sun, 22 Dec 2013 19:25:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-value-of-one-field-if-the-value-of-another/m-p/187790#M54128</guid>
      <dc:creator>harshal_chakran</dc:creator>
      <dc:date>2013-12-22T19:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the value of one field if the value of another field matches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-value-of-one-field-if-the-value-of-another/m-p/187791#M54129</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;... | eval myval=if(match(variable2,"123"),variable1,"")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Dec 2013 20:30:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-value-of-one-field-if-the-value-of-another/m-p/187791#M54129</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-12-22T20:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the value of one field if the value of another field matches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-value-of-one-field-if-the-value-of-another/m-p/187792#M54130</link>
      <description>&lt;P&gt;How about:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;variable2=123 | fields variable1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2013 01:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-value-of-one-field-if-the-value-of-another/m-p/187792#M54130</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-12-23T01:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get the value of one field if the value of another field matches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-value-of-one-field-if-the-value-of-another/m-p/187793#M54131</link>
      <description>&lt;P&gt;It would b great if you can provide sample output you're expecting...&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2013 02:39:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-the-value-of-one-field-if-the-value-of-another/m-p/187793#M54131</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-12-23T02:39:43Z</dc:date>
    </item>
  </channel>
</rss>

