<?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 Compare two searches in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Compare-two-searches/m-p/525547#M9855</link>
    <description>&lt;P&gt;Hi everybody, I hope someone can help me out. I appreciate any further comments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two searches that I have to compare but they have different formats:&lt;/P&gt;&lt;P&gt;First search:&lt;/P&gt;&lt;P&gt;index="schedule" "uploaded to S3, number of rows:"&lt;BR /&gt;| rex "File (?&amp;lt;table_name&amp;gt;.*?csv)"&lt;BR /&gt;| eval table_name=substr(table_name, 0, len(table_name) - 28)&lt;BR /&gt;| eval rows = replace(Success,"number of rows:","")&lt;BR /&gt;| eval rows = substr(rows, 1, len(rows)-1)&lt;BR /&gt;| eval trans_date=strftime(_time, "%m-%d-%y")&lt;BR /&gt;| search trans_date=10-14-20&lt;BR /&gt;| stats sum(rows) as rows by warehouse, table_name, trans_date&lt;BR /&gt;| table table_name, trans_date, rows&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="felipesodre_3-1603190694286.png" style="width: 761px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11377iC9D4D5DC48FF6702/image-dimensions/761x69?v=v2" width="761" height="69" role="button" title="felipesodre_3-1603190694286.png" alt="felipesodre_3-1603190694286.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second search:&lt;/P&gt;&lt;P&gt;index=schedule TransactionPurgingSummary AND "\"newPurging\":true" | rex "TransactionPurgingSummary: (?&amp;lt;TransactionPurgingSummary&amp;gt;.*?})"&lt;BR /&gt;| spath input=TransactionPurgingSummary&lt;BR /&gt;| eval trans_date=strftime(_time, "%m-%d-%y")&lt;BR /&gt;| search objectsPurgedSummary.transaction0 &amp;gt; 0&lt;BR /&gt;| stats sum(objectsPurgedSummary.transaction0) as b_transaction0, sum(objectsPurgedSummary.auxiliarymessage) as b_auxiliarymessage, sum(objectsPurgedSummary.transactionmessage) as b_transactionmessage, sum(objectsPurgedSummary.transactionmessagevalue) as b_transactionmessagevalue, sum(objectsPurgedSummary.trans_transactionmessages) as b_trans_transactionmessages, sum(objectsPurgedSummary.labelling_transaction_pfd_link_tb) as b_labelling_transaction_pfd_link_tb, sum(objectsPurgedSummary.labelling_transaction_alert_link_tb) as b_labelling_transaction_alert_link_tb by warehouse, trans_date&lt;BR /&gt;| table trans_date, b_transaction0, b_auxiliarymessage, b_transactionmessage, b_transactionmessagevalue, b_trans_transactionmessages, b_labelling_transaction_pfd_link_tb, b_labelling_transaction_alert_link_tb&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="felipesodre_1-1603190384006.png" style="width: 779px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11375iDBCF099F553A1D97/image-dimensions/779x37?v=v2" width="779" height="37" role="button" title="felipesodre_1-1603190384006.png" alt="felipesodre_1-1603190384006.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am aim creating an alert that compares the first query table_name and rows to the second query the value in the correspondent table name by tarns_date eg:&lt;/P&gt;&lt;P&gt;&amp;nbsp;transaction0 rows = b_transaction0&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Oct 2020 10:48:59 GMT</pubDate>
    <dc:creator>felipesodre</dc:creator>
    <dc:date>2020-10-20T10:48:59Z</dc:date>
    <item>
      <title>Compare two searches</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-two-searches/m-p/525547#M9855</link>
      <description>&lt;P&gt;Hi everybody, I hope someone can help me out. I appreciate any further comments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two searches that I have to compare but they have different formats:&lt;/P&gt;&lt;P&gt;First search:&lt;/P&gt;&lt;P&gt;index="schedule" "uploaded to S3, number of rows:"&lt;BR /&gt;| rex "File (?&amp;lt;table_name&amp;gt;.*?csv)"&lt;BR /&gt;| eval table_name=substr(table_name, 0, len(table_name) - 28)&lt;BR /&gt;| eval rows = replace(Success,"number of rows:","")&lt;BR /&gt;| eval rows = substr(rows, 1, len(rows)-1)&lt;BR /&gt;| eval trans_date=strftime(_time, "%m-%d-%y")&lt;BR /&gt;| search trans_date=10-14-20&lt;BR /&gt;| stats sum(rows) as rows by warehouse, table_name, trans_date&lt;BR /&gt;| table table_name, trans_date, rows&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="felipesodre_3-1603190694286.png" style="width: 761px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11377iC9D4D5DC48FF6702/image-dimensions/761x69?v=v2" width="761" height="69" role="button" title="felipesodre_3-1603190694286.png" alt="felipesodre_3-1603190694286.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second search:&lt;/P&gt;&lt;P&gt;index=schedule TransactionPurgingSummary AND "\"newPurging\":true" | rex "TransactionPurgingSummary: (?&amp;lt;TransactionPurgingSummary&amp;gt;.*?})"&lt;BR /&gt;| spath input=TransactionPurgingSummary&lt;BR /&gt;| eval trans_date=strftime(_time, "%m-%d-%y")&lt;BR /&gt;| search objectsPurgedSummary.transaction0 &amp;gt; 0&lt;BR /&gt;| stats sum(objectsPurgedSummary.transaction0) as b_transaction0, sum(objectsPurgedSummary.auxiliarymessage) as b_auxiliarymessage, sum(objectsPurgedSummary.transactionmessage) as b_transactionmessage, sum(objectsPurgedSummary.transactionmessagevalue) as b_transactionmessagevalue, sum(objectsPurgedSummary.trans_transactionmessages) as b_trans_transactionmessages, sum(objectsPurgedSummary.labelling_transaction_pfd_link_tb) as b_labelling_transaction_pfd_link_tb, sum(objectsPurgedSummary.labelling_transaction_alert_link_tb) as b_labelling_transaction_alert_link_tb by warehouse, trans_date&lt;BR /&gt;| table trans_date, b_transaction0, b_auxiliarymessage, b_transactionmessage, b_transactionmessagevalue, b_trans_transactionmessages, b_labelling_transaction_pfd_link_tb, b_labelling_transaction_alert_link_tb&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="felipesodre_1-1603190384006.png" style="width: 779px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11375iDBCF099F553A1D97/image-dimensions/779x37?v=v2" width="779" height="37" role="button" title="felipesodre_1-1603190384006.png" alt="felipesodre_1-1603190384006.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am aim creating an alert that compares the first query table_name and rows to the second query the value in the correspondent table name by tarns_date eg:&lt;/P&gt;&lt;P&gt;&amp;nbsp;transaction0 rows = b_transaction0&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 10:48:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-two-searches/m-p/525547#M9855</guid>
      <dc:creator>felipesodre</dc:creator>
      <dc:date>2020-10-20T10:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two searches</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-two-searches/m-p/525549#M9856</link>
      <description>&lt;P&gt;first_search&amp;nbsp;&lt;BR /&gt;| append [ search second_search&lt;BR /&gt;| rename b_* as *&lt;BR /&gt;| untable trans_date table_name rows]&lt;BR /&gt;| stats values(*) as * by trans_date&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I don't know how to make the comparison.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; .... | eval rows=-1 * rows]&lt;BR /&gt;&amp;nbsp; | stats sum(*) as * by&amp;nbsp;trans_date&lt;BR /&gt;&amp;nbsp; | where rows &amp;gt; 0&lt;BR /&gt;&lt;BR /&gt;like that?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 11:06:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-two-searches/m-p/525549#M9856</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-10-20T11:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two searches</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-two-searches/m-p/525553#M9857</link>
      <description>&lt;P&gt;The untable was the key for what I wanted. I just did a few adptations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your help here is my final solution:&lt;/P&gt;&lt;P&gt;index=schedule TransactionPurgingSummary AND "\"newPurging\":true" | rex "TransactionPurgingSummary: (?&amp;lt;TransactionPurgingSummary&amp;gt;.*?})"&lt;BR /&gt;| spath input=TransactionPurgingSummary&lt;BR /&gt;| eval trans_date=strftime(_time, "%m-%d-%y")&lt;BR /&gt;| search objectsPurgedSummary.transaction0 &amp;gt; 0&lt;BR /&gt;| stats sum(objectsPurgedSummary.transaction0) as transaction0, sum(objectsPurgedSummary.auxiliarymessage) as auxiliarymessage, sum(objectsPurgedSummary.transactionmessage) as b_transactionmessage, sum(objectsPurgedSummary.transactionmessagevalue) as transactionmessagevalue, sum(objectsPurgedSummary.trans_transactionmessages) as trans_transactionmessages, sum(objectsPurgedSummary.labelling_transaction_pfd_link_tb) as labelling_transaction_pfd_link_tb, sum(objectsPurgedSummary.labelling_transaction_alert_link_tb) as labelling_transaction_alert_link_tb by warehouse, trans_date&lt;BR /&gt;| table trans_date, transaction0, auxiliarymessage, transactionmessage, transactionmessagevalue, trans_transactionmessages, labelling_transaction_pfd_link_tb, b_labelling_transaction_alert_link_tb&lt;BR /&gt;| untable trans_date table_name b_rows&lt;BR /&gt;| join warehouse, table_name, trans_date&lt;BR /&gt;[search index="schedule" "uploaded to S3, number of rows:"&lt;BR /&gt;| rex "File (?&amp;lt;table_name&amp;gt;.*?csv)"&lt;BR /&gt;| eval table_name=substr(table_name, 0, len(table_name) - 28)&lt;BR /&gt;| eval rows = replace(Success,"number of rows:","")&lt;BR /&gt;| eval rows = substr(rows, 1, len(rows)-1)&lt;BR /&gt;| eval trans_date=strftime(_time, "%m-%d-%y")&lt;BR /&gt;| search trans_date=10-14-20&lt;BR /&gt;| stats sum(rows) as rows by warehouse, table_name, trans_date&lt;BR /&gt;| table table_name, trans_date, rows]&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 12:35:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-two-searches/m-p/525553#M9857</guid>
      <dc:creator>felipesodre</dc:creator>
      <dc:date>2020-10-20T12:35:40Z</dc:date>
    </item>
  </channel>
</rss>

