<?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: need to compare two conditions in splunk query in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/How-to-compare-two-conditions-in-splunk-query/m-p/605246#M9041</link>
    <description>&lt;P&gt;This is a bit confusing - are you trying to set severityType to FATAL if response code is one of the 400 codes or 500 and return code is a particular value?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval severityType=if(httpResponseCode=400 OR httpResponseCode=401 OR httpResponseCode=403 OR httpResponseCode=404 OR (httpResponseCode=500 AND returnCode="APS.API.6544"), "FATAL", "NOT FATAL")&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 12 Jul 2022 07:54:34 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-07-12T07:54:34Z</dc:date>
    <item>
      <title>How to compare two conditions in splunk query</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-to-compare-two-conditions-in-splunk-query/m-p/605242#M9040</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I am trying to fetch events by comparing two conditions where i am&amp;nbsp; unable to do that.&lt;BR /&gt;I have sample log like this:&lt;BR /&gt;&lt;SPAN&gt;[15:53:12.172] [WARN ] [] [c.c.n.t.e.i.T.ServiceCalloutEventData] [] - channel="null", productVersion="2FE1-5634ab725", apiVersion="V1", uuid="2Fedec2-16f0-4988-b1fa-68db0c565a9f", eventDateTime="2022-07-11T05:53:12.172Z", severity="WARN", code="ServfefrventData", component="wDEGG", category="integrational-eFsdal", serviceName="Details", eventName="_RESPONSE", message="CadfSFDresponse",&amp;nbsp; start="1657518790580", stop="1657518792172", elapsed="1592", exceptionInfo="null", url="&lt;A href="https://scdssfg.com/npp-mms/v1/mandates/actions/DVd" target="_blank" rel="noopener"&gt;https://scdssfg.com/npp-mms/v1/mandates/actions/DVd&lt;/A&gt;", &lt;STRONG&gt;httpResponseCode="500"&lt;/STRONG&gt;, priority="NORM", servicingAgentBIC="CTBAAUSNXXX", swiftMessagePartnerBIC="RESTMP1", messageIdentification="beb727a900dd11edaf1a69ae7e224ce5", mandateIdentification="111536a1519111ec9bb20e6904f27a9e", &lt;STRONG&gt;returnCode="APS.API.6544&lt;/STRONG&gt;"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I need to fetch all the events with all httpstatuscode and compare with returncode and then decide the severity type.&lt;BR /&gt;For all statuscode type cannot differ but for only 500(httpstatus code)based on returncode the severitytype would differ.&lt;BR /&gt;So i need to write query for httpstatus code when it hits 500 it has to check return code and for remaining no need to check any returncode.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=a_audit |rex field=log "eventName=\"*(?&amp;lt;eventName&amp;gt;[^,\"\s]+)"|rex field=log "serviceName=\"*(?&amp;lt;serviceName&amp;gt;[^\"]+)"|rex field=log "severity=\"*(?&amp;lt;severity&amp;gt;[^\"]+)"|rex field=log "exceptionInfo=\"*(?&amp;lt;exceptionInfo&amp;gt;[^\"]+)"|rex field=log "httpResponseCode=\"*(?&amp;lt;httpResponseCode&amp;gt;[^\"]+)"|rex field=log "returnCode=\"*(?&amp;lt;returnCode&amp;gt;[^\"]+)"|stats count by eventName serviceName severity exceptionInfo httpResponseCode returnCode|search serviceName="Details" AND eventName="RESPONSE" AND (severity=ERROR OR severity=WARN) |eval severityType=(httpResponseCode=400 OR httpResponseCode=401 OR httpResponseCode=403 OR httpResponseCode=404 "FATAL") AND (httpResponseCode=500 IN (returnCode=APS.API.6544) |where count&amp;gt;1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i cant able to compare 2 conditions for same field.Can you help me on the same.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 13:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-to-compare-two-conditions-in-splunk-query/m-p/605242#M9040</guid>
      <dc:creator>vineela</dc:creator>
      <dc:date>2022-07-12T13:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: need to compare two conditions in splunk query</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-to-compare-two-conditions-in-splunk-query/m-p/605246#M9041</link>
      <description>&lt;P&gt;This is a bit confusing - are you trying to set severityType to FATAL if response code is one of the 400 codes or 500 and return code is a particular value?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval severityType=if(httpResponseCode=400 OR httpResponseCode=401 OR httpResponseCode=403 OR httpResponseCode=404 OR (httpResponseCode=500 AND returnCode="APS.API.6544"), "FATAL", "NOT FATAL")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Jul 2022 07:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-to-compare-two-conditions-in-splunk-query/m-p/605246#M9041</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-12T07:54:34Z</dc:date>
    </item>
  </channel>
</rss>

