<?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: Hi, can you help me?? How can I do Three search in the same query, but the results separate for a week in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Hi-can-you-help-me-How-can-I-do-Three-search-in-the-same-query/m-p/553902#M157252</link>
    <description>&lt;P&gt;Before the last table command add&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(*) as * by _time&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 01 Jun 2021 17:35:36 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-06-01T17:35:36Z</dc:date>
    <item>
      <title>Hi, can you help me?? How can I do Three search in the same query, but the results separate for a week</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hi-can-you-help-me-How-can-I-do-Three-search-in-the-same-query/m-p/553900#M157251</link>
      <description>&lt;P&gt;How can I do Three search in the same query, but the results separate for a week (the results of last 4 weeks), and the result of the three search do a operation math for a final result.&lt;/P&gt;&lt;P&gt;///////////////////////////&lt;/P&gt;&lt;P&gt;This is my query:&lt;/P&gt;&lt;P&gt;index="main_alarms"&lt;BR /&gt;| search entity_name ="*"&lt;BR /&gt;| dedup alarm_id, source&lt;BR /&gt;| where _time&amp;gt;relative_time(now(),"-4w@w")&lt;BR /&gt;| bin _time span=1w&lt;BR /&gt;| stats count as eventcount by _time&lt;BR /&gt;| rename eventcount as "TotalAlerts"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| append [ search index="main_alarms"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| dedup alarm_id, source&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| search entity_name ="*"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| search alarm_rule="*"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| where _time&amp;gt;relative_time(now(),"-4w@w")&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| bin _time span=1w&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| where alarm_status_desc = "Closed: False Alarm"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| stats count as alarm_status_desc by _time&lt;BR /&gt;&amp;nbsp; &amp;nbsp;| rename alarm_status_desc as "AlertsFalse"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | append [search index="main_alarms"&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | dedup alarm_id, source&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | search entity_name ="*"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | dedup alarm_id, source&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | search alarm_status_desc="*" alarm_rule="*" ActionStatus=*&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | where _time&amp;gt;relative_time(now(),"-4w@w")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | bin _time span=1w&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | stats count as eventcount1 by _time&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | rename eventcount1 as "AlertsSmart"]&lt;BR /&gt;| table "TotalAlerts"&amp;nbsp;"AlertsFalse"&amp;nbsp;"AlertsSmart"&lt;/P&gt;&lt;P&gt;/////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;But this is the result&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DavidRojas_0-1622567463389.png" style="width: 701px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14399i57179A5C827B358D/image-dimensions/701x289?v=v2" width="701" height="289" role="button" title="DavidRojas_0-1622567463389.png" alt="DavidRojas_0-1622567463389.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;//////////////////////////////////////////&lt;/P&gt;&lt;P&gt;How can I get the result to be in the same row and then do the difference of the week?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;| eval Diff=(("TotalAlerts")-("AlertsFalse"+"AlertsSmart"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- The same index in the 3 searchs&lt;/P&gt;&lt;P&gt;- The last 4 weeks&lt;/P&gt;&lt;P&gt;- Diference =(A-(B+C))&lt;/P&gt;&lt;P&gt;- Chart the Columns A B C Diference&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 17:28:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hi-can-you-help-me-How-can-I-do-Three-search-in-the-same-query/m-p/553900#M157251</guid>
      <dc:creator>DavidRojas</dc:creator>
      <dc:date>2021-06-01T17:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Hi, can you help me?? How can I do Three search in the same query, but the results separate for a week</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hi-can-you-help-me-How-can-I-do-Three-search-in-the-same-query/m-p/553902#M157252</link>
      <description>&lt;P&gt;Before the last table command add&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(*) as * by _time&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Jun 2021 17:35:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hi-can-you-help-me-How-can-I-do-Three-search-in-the-same-query/m-p/553902#M157252</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-01T17:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Hi, can you help me?? How can I do Three search in the same query, but the results separate for a week</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Hi-can-you-help-me-How-can-I-do-Three-search-in-the-same-query/m-p/553952#M157254</link>
      <description>&lt;P&gt;Thak you&amp;nbsp;&lt;SPAN&gt;ITWhisperer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thak you ITWhisperer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Add this 3 lines in my Query, and the result successfully, thank you so much&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;| stats values(*) as * by _time&lt;BR /&gt;| eval Diff=((AlertsTotals)-(AlertsSmart+AlertsFalse))&lt;BR /&gt;| table AlertsTotals AlertsFalse AlertsSmart Diff&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DavidRojas_0-1622575632190.png" style="width: 753px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14414iB0E6FD8AA05CF054/image-dimensions/753x145?v=v2" width="753" height="145" role="button" title="DavidRojas_0-1622575632190.png" alt="DavidRojas_0-1622575632190.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 19:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Hi-can-you-help-me-How-can-I-do-Three-search-in-the-same-query/m-p/553952#M157254</guid>
      <dc:creator>DavidRojas</dc:creator>
      <dc:date>2021-06-01T19:27:33Z</dc:date>
    </item>
  </channel>
</rss>

