<?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: How to Use IF or Case condition in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-Use-IF-or-Case-condition/m-p/546744#M155001</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;SPAN class=""&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168" target="_self"&gt;ITWhisperer&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;But I am getting error in compile:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13613i2F08A5CC6E3E8539/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.PNG" alt="error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Apr 2021 19:03:54 GMT</pubDate>
    <dc:creator>alex5441</dc:creator>
    <dc:date>2021-04-05T19:03:54Z</dc:date>
    <item>
      <title>How to Use IF or Case condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Use-IF-or-Case-condition/m-p/546732#M154995</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My logs are in following format:&lt;/P&gt;&lt;P&gt;{[-]&lt;/P&gt;&lt;P&gt;logger: .......&lt;/P&gt;&lt;P&gt;message: ..........&lt;/P&gt;&lt;P&gt;severity: Error&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;{[-]&lt;/P&gt;&lt;P&gt;exception: .........&lt;/P&gt;&lt;P&gt;logger: .......&lt;/P&gt;&lt;P&gt;message: ..........&lt;/P&gt;&lt;P&gt;severity: Error&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;my query is :&lt;/P&gt;&lt;P&gt;........| rex "\"exception\":\"(&amp;lt;ErrorMsg&amp;gt;.*?)\"" | table Application, ErrorMsg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue:&lt;/P&gt;&lt;P&gt;As some app logs have key "message" and some logs have both "exception" and "message".&lt;/P&gt;&lt;P&gt;How can I change my query that first it checks if there is key exception, if it does get the value of that key. If there is no Key exception check if there is key "message", if it does get the value of that.&lt;/P&gt;&lt;P&gt;My current query is able to get the value of exception (if I change exception to message, it gets the value of message. But trying to implement IF or CASE condition here)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 17:31:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Use-IF-or-Case-condition/m-p/546732#M154995</guid>
      <dc:creator>alex5441</dc:creator>
      <dc:date>2021-04-05T17:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use IF or Case condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Use-IF-or-Case-condition/m-p/546737#M154999</link>
      <description>&lt;P&gt;Try something like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(\"exception\":\"(?&amp;lt;ErrorMsg&amp;gt;.*?)\"|\"message\":\"(?&amp;lt;Message&amp;gt;.*?)\")"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Apr 2021 18:17:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Use-IF-or-Case-condition/m-p/546737#M154999</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-05T18:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use IF or Case condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Use-IF-or-Case-condition/m-p/546744#M155001</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;SPAN class=""&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168" target="_self"&gt;ITWhisperer&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;But I am getting error in compile:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13613i2F08A5CC6E3E8539/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.PNG" alt="error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 19:03:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Use-IF-or-Case-condition/m-p/546744#M155001</guid>
      <dc:creator>alex5441</dc:creator>
      <dc:date>2021-04-05T19:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use IF or Case condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Use-IF-or-Case-condition/m-p/546747#M155002</link>
      <description>&lt;P&gt;Try with different names as in my example&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 19:26:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Use-IF-or-Case-condition/m-p/546747#M155002</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-05T19:26:21Z</dc:date>
    </item>
  </channel>
</rss>

