<?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: Using condition setting the status in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-condition-setting-the-status/m-p/510605#M2765</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/216214"&gt;@vikashperiwal&lt;/a&gt;&amp;nbsp;Based on your question seems like only if value_status in your data is already failed you want to use that value for deriving Overall Status. For other value_status, the Overall Status is determined based on whether you have End Date present in data or not. So try the following eval:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats values(value_status) as status_values by id
| eval Ov_status=case(status_values=="Failed","Failed",
    isnotnull(start_time) AND isnull(end_time ),"Inprogress",
    isnotnull(start_time) AND isnotnull(end_time ),"Completed",
    true(),"Unknown")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Following is a run anywhere example based on the details provided:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval data="xyz.123 2020-07-22 Failed -;xyz.123 2020-07-22 Completed 2020-07-22;abc.321 2020-07-22 Inprogress -;" 
| makemv data delim=";" 
| mvexpand data 
| makemv data delim=" " 
| eval id=mvindex(data,0), start_time=mvindex(data,1), value_status=mvindex(data,2), end_time=mvindex(data,3) 
| eval end_time=case(end_time!="-",end_time) 
| table id start_time end_time value_status 
| eventstats values(value_status) as status_values by id
| eval Ov_status=case(match(status_values,"Failed"),"Failed",
    isnotnull(start_time) AND isnull(end_time ),"Inprogress",
    isnotnull(start_time) AND isnotnull(end_time ),"Completed",
    true(),"Unknown")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2020 09:59:30 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-07-23T09:59:30Z</dc:date>
    <item>
      <title>Using condition setting the status</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-condition-setting-the-status/m-p/510489#M2747</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am trying to achive a logic for below scenario , but getting conflict ..&lt;/P&gt;
&lt;P&gt;Table&lt;/P&gt;
&lt;TABLE border="1" width="90.20202020202021%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;id&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;start_time&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;end_time&amp;nbsp;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Ov_status&lt;/TD&gt;
&lt;TD width="10%" height="25px"&gt;value&lt;/TD&gt;
&lt;TD width="5%" height="25px"&gt;value_status&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;xyz.123&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2020-07-22&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Inprogress&lt;/TD&gt;
&lt;TD width="10%" height="25px"&gt;myvalue&lt;/TD&gt;
&lt;TD width="5%" height="25px"&gt;Failed&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;xyz.123&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2020-07-22&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2020-07-22&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;completed&lt;/TD&gt;
&lt;TD width="10%" height="25px"&gt;yourval&lt;/TD&gt;
&lt;TD width="5%" height="25px"&gt;Completed&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;abc.321&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2020-07-22&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Inprogress&lt;/TD&gt;
&lt;TD width="10%" height="25px"&gt;isval&lt;/TD&gt;
&lt;TD width="5%" height="25px"&gt;Inprogress&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here i have used below case statement to get Ov_status&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval Ov_status=case(isnotnull(start_time) AND isnull(end_time ),"Inprogress",isnotnull(start_time) AND isnotnull(end_time ),"completed")&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Now i want if value_status is failed for any value of id(xyz.123) the Ov_status should reset to failed&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 03:17:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-condition-setting-the-status/m-p/510489#M2747</guid>
      <dc:creator>vikashperiwal</dc:creator>
      <dc:date>2020-07-23T03:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: using condition setting the status</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-condition-setting-the-status/m-p/510524#M2753</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;How about this:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;| eval Ov_status=case(id="xyz.123" AND value_status="Failed","Failed", isnotnull(start_time) AND isnull(end_time ),"Inprogress",isnotnull(start_time) AND isnotnull(end_time ),"completed")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Jul 2020 19:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-condition-setting-the-status/m-p/510524#M2753</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-22T19:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: using condition setting the status</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-condition-setting-the-status/m-p/510561#M2757</link>
      <description>&lt;P&gt;Thanks for the response..&lt;/P&gt;&lt;P&gt;Here the the ID is dynamic , i may have 100 of ID"s and each id is associated with some values and each value has a status called value status.&lt;/P&gt;&lt;P&gt;If my value status is failed i need to make my overall status f field for all the values present is that I'd...&lt;/P&gt;&lt;P&gt;I was thnking of some thing below&lt;/P&gt;&lt;P&gt;|eval Ov_status= if(value_status=="failed" OR&amp;nbsp;value_status=="Inprogress" or value_status=="completed", "failed",Ov_status)..&lt;/P&gt;&lt;P&gt;But above condition&amp;nbsp; is making all my Ov_status to failed irrespective of checking ID&lt;/P&gt;&lt;P&gt;I want to filter by ID&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 02:05:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-condition-setting-the-status/m-p/510561#M2757</guid>
      <dc:creator>vikashperiwal</dc:creator>
      <dc:date>2020-07-23T02:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using condition setting the status</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-condition-setting-the-status/m-p/510605#M2765</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/216214"&gt;@vikashperiwal&lt;/a&gt;&amp;nbsp;Based on your question seems like only if value_status in your data is already failed you want to use that value for deriving Overall Status. For other value_status, the Overall Status is determined based on whether you have End Date present in data or not. So try the following eval:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats values(value_status) as status_values by id
| eval Ov_status=case(status_values=="Failed","Failed",
    isnotnull(start_time) AND isnull(end_time ),"Inprogress",
    isnotnull(start_time) AND isnotnull(end_time ),"Completed",
    true(),"Unknown")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Following is a run anywhere example based on the details provided:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval data="xyz.123 2020-07-22 Failed -;xyz.123 2020-07-22 Completed 2020-07-22;abc.321 2020-07-22 Inprogress -;" 
| makemv data delim=";" 
| mvexpand data 
| makemv data delim=" " 
| eval id=mvindex(data,0), start_time=mvindex(data,1), value_status=mvindex(data,2), end_time=mvindex(data,3) 
| eval end_time=case(end_time!="-",end_time) 
| table id start_time end_time value_status 
| eventstats values(value_status) as status_values by id
| eval Ov_status=case(match(status_values,"Failed"),"Failed",
    isnotnull(start_time) AND isnull(end_time ),"Inprogress",
    isnotnull(start_time) AND isnotnull(end_time ),"Completed",
    true(),"Unknown")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 09:59:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-condition-setting-the-status/m-p/510605#M2765</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-07-23T09:59:30Z</dc:date>
    </item>
  </channel>
</rss>

