<?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 to merge two diff queries, but display only if the patching has happened? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-diff-queries-but-display-only-if-the-patching/m-p/646002#M223640</link>
    <description>&lt;P&gt;Index = prod-x7 host IN ( 12345678) sourcetype=“Wineventlog” Eventcode=“19”&lt;/P&gt;
&lt;P&gt;|eval patching = if(eventcode =“19”, “ok”, “not ok”)&lt;/P&gt;
&lt;P&gt;If events are found then search server availability i.e.,&lt;/P&gt;
&lt;P&gt;index= server_123 host in (12345678) uri_stem IN (http/hltchck)&lt;/P&gt;
&lt;P&gt;| status count eval( status=100) as success, count as total by _time&lt;/P&gt;
&lt;P&gt;|eval Percent = round((Success/total)*100,2)&lt;/P&gt;
&lt;P&gt;| table Percent&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how to merge this two diff querys. But display only if the patching has happened&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2023 21:11:21 GMT</pubDate>
    <dc:creator>haripotu</dc:creator>
    <dc:date>2023-06-06T21:11:21Z</dc:date>
    <item>
      <title>How to merge two diff queries, but display only if the patching has happened?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-diff-queries-but-display-only-if-the-patching/m-p/646002#M223640</link>
      <description>&lt;P&gt;Index = prod-x7 host IN ( 12345678) sourcetype=“Wineventlog” Eventcode=“19”&lt;/P&gt;
&lt;P&gt;|eval patching = if(eventcode =“19”, “ok”, “not ok”)&lt;/P&gt;
&lt;P&gt;If events are found then search server availability i.e.,&lt;/P&gt;
&lt;P&gt;index= server_123 host in (12345678) uri_stem IN (http/hltchck)&lt;/P&gt;
&lt;P&gt;| status count eval( status=100) as success, count as total by _time&lt;/P&gt;
&lt;P&gt;|eval Percent = round((Success/total)*100,2)&lt;/P&gt;
&lt;P&gt;| table Percent&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how to merge this two diff querys. But display only if the patching has happened&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 21:11:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-diff-queries-but-display-only-if-the-patching/m-p/646002#M223640</guid>
      <dc:creator>haripotu</dc:creator>
      <dc:date>2023-06-06T21:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge two diff queries, but display only if the patching has happened?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-diff-queries-but-display-only-if-the-patching/m-p/646017#M223648</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234667"&gt;@haripotu&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at first, in&amp;nbsp; the first search, if you put the condition EventCode=19, the second row is useless because you have only ok events.&lt;/P&gt;&lt;P&gt;Then, if you want to use _time in a stats command, you have to group timestamps using the bin, command, e.g. for one hour.&lt;/P&gt;&lt;P&gt;so you can merge the two searches in this way:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= server_123 host IN (12345678) uri_stem IN (http/hltchck) [ search index=prod-x7 host IN (12345678) sourcetype=“Wineventlog” Eventcode=“19” | fields host ]
| bin span=1h _time
| stats 
   count eval(status=100) AS success 
   count AS total 
   BY _time
|eval Percent=round((Success/total)*100,2)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 06:28:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-diff-queries-but-display-only-if-the-patching/m-p/646017#M223648</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-07T06:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge two diff queries, but display only if the patching has happened?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-diff-queries-but-display-only-if-the-patching/m-p/646227#M223695</link>
      <description>&lt;P&gt;But i need the second percent search (percent &amp;nbsp;query) only if we find events for event code =19&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 03:40:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-diff-queries-but-display-only-if-the-patching/m-p/646227#M223695</guid>
      <dc:creator>haripotu</dc:creator>
      <dc:date>2023-06-08T03:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge two diff queries, but display only if the patching has happened?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-diff-queries-but-display-only-if-the-patching/m-p/646251#M223699</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234667"&gt;@haripotu&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you want the percent of EventCode=19 over all the events, you could run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= server_123 host IN (12345678) uri_stem IN (http/hltchck)fields host
| bin span=1h _time
| stats 
   count(eval(status=100) AS success 
   count AS total 
   BY _time host
| search [ search index=prod-x7 host IN (12345678) sourcetype=“Wineventlog” Eventcode=“19” | fields host ]
| stats 
   sum(count) AS Success 
   values(total) AS total
   BY _time
| eval Percent=round((Success/total)*100,2)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 06:22:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-two-diff-queries-but-display-only-if-the-patching/m-p/646251#M223699</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-08T06:22:01Z</dc:date>
    </item>
  </channel>
</rss>

