<?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 consider values of a field from the events of type1 when does not exist in type2? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-consider-values-of-a-field-from-the-events-of-type1-when/m-p/423670#M121576</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;the Answer depends on how exactly your events look like. But in general you can do something with stats to get both fields in one event:&lt;/P&gt;

&lt;P&gt;your search | | stats list(Success) as l_success by id | eval Success=mvindex(l_success,0)&lt;/P&gt;

&lt;P&gt;I think to finally answer this question, we need more information about your events.&lt;/P&gt;

&lt;P&gt;Greetings&lt;/P&gt;

&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:18:01 GMT</pubDate>
    <dc:creator>tom_frotscher</dc:creator>
    <dc:date>2020-09-29T22:18:01Z</dc:date>
    <item>
      <title>How to consider values of a field from the events of type1 when does not exist in type2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-consider-values-of-a-field-from-the-events-of-type1-when/m-p/423668#M121574</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have got two type of events, typeA and typeB, In both the fields I'm interested in only a single field "Success".&lt;BR /&gt;
Either if the field Success does not exist or it's value is "" in typeA then it should consider the value of Success from the typeB.&lt;BR /&gt;
How do I do this?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 10:12:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-consider-values-of-a-field-from-the-events-of-type1-when/m-p/423668#M121574</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2018-12-05T10:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to consider values of a field from the events of type1 when does not exist in type2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-consider-values-of-a-field-from-the-events-of-type1-when/m-p/423669#M121575</link>
      <description>&lt;P&gt;Update:&lt;/P&gt;

&lt;P&gt;both types will have a common id. If typeA does not contain the "Success" with id "123", It should consider the value of "Success" from typeB which as same id "123"&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 10:24:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-consider-values-of-a-field-from-the-events-of-type1-when/m-p/423669#M121575</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2018-12-05T10:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to consider values of a field from the events of type1 when does not exist in type2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-consider-values-of-a-field-from-the-events-of-type1-when/m-p/423670#M121576</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;the Answer depends on how exactly your events look like. But in general you can do something with stats to get both fields in one event:&lt;/P&gt;

&lt;P&gt;your search | | stats list(Success) as l_success by id | eval Success=mvindex(l_success,0)&lt;/P&gt;

&lt;P&gt;I think to finally answer this question, we need more information about your events.&lt;/P&gt;

&lt;P&gt;Greetings&lt;/P&gt;

&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:18:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-consider-values-of-a-field-from-the-events-of-type1-when/m-p/423670#M121576</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2020-09-29T22:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to consider values of a field from the events of type1 when does not exist in type2?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-consider-values-of-a-field-from-the-events-of-type1-when/m-p/423671#M121577</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/210964"&gt;@tom_frotscher&lt;/a&gt;, Please find the events and a bit more description on the requirement.&lt;/P&gt;

&lt;P&gt;I have got events with two different types, Type=First and type=Second&lt;/P&gt;

&lt;P&gt;I would like to get the consolidated(with unique tags) from both the types based on the following conditions.&lt;/P&gt;

&lt;P&gt;If both types have a values of tag then on priority it should consider value of tag from the type=First and ignore the tag value from type=Second even if it has value or not.&lt;BR /&gt;
ii) If tag has no value i.e., "" in type=First and tag of type=Second has tha value then it consider the value from type=Second for the same id of type=First.&lt;BR /&gt;
iii) if both the types has no value in tag. we can ignore this.&lt;/P&gt;

&lt;P&gt;Note: the values of id_first and id_second has same values but the naming convention is different.&lt;/P&gt;

&lt;P&gt;time=1544071583425 type="First" version="2.0.5" status="OK"  id_first="210468"  user="abc" tag="some"&lt;BR /&gt;
time=1544071583425 type="First" version="2.0.5" status="OK"  id_first="210469"  user="xyz" tag=""&lt;BR /&gt;
time=1544071583424 type="First" version="2.0.5" status="OK"  id_first="210470"  user="wow" tag=""&lt;BR /&gt;
time=1544071583424 type="First" version="2.0.5" status="OK"  id_first="210483"  user="rez" &lt;BR /&gt;
time=1544071583424 type="First" version="2.0.5" status="OK"  id_first="210487"  user="yov" tag="wrong"&lt;BR /&gt;
time=1544071583424 type="First" version="2.0.5" status="OK"  id_first="210491"  user="boh" tag=""&lt;/P&gt;

&lt;P&gt;time=1544071583425 type="Second" version="2.0.5" status="OK"  id_second="210468"  user="abc" tag="some"&lt;BR /&gt;
time=1544071583425 type="Second" version="2.0.5" status="OK"  id_second="210469"  user="xyz" tag="where"&lt;BR /&gt;
time=1544071583424 type="Second" version="2.0.5" status="OK"  id_second="210470"  user="wow" tag="fishy&lt;BR /&gt;
time=1544071583424 type="Second" version="2.0.5" status="OK"  id_second="210483"  user="rez" &lt;BR /&gt;
time=1544071583424 type="Second" version="2.0.5" status="OK"  id_second="210487"  user="yov" tag="wrong"&lt;BR /&gt;
time=1544071583424 type="Second" version="2.0.5" status="OK"  id_second="210491"  user="boh" tag="great"&lt;/P&gt;

&lt;P&gt;output:&lt;/P&gt;

&lt;P&gt;tag          id&lt;BR /&gt;
some        210469&lt;BR /&gt;
where       210469&lt;BR /&gt;
fishy       210470&lt;BR /&gt;
wrong       210483&lt;BR /&gt;
great       210487&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:18:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-consider-values-of-a-field-from-the-events-of-type1-when/m-p/423671#M121577</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2020-09-29T22:18:15Z</dc:date>
    </item>
  </channel>
</rss>

