<?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 Use EVAL and Case for Windows EventCodes to provide information in table output. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-EVAL-and-Case-for-Windows-EventCodes-to-provide-information/m-p/160675#M45434</link>
    <description>&lt;P&gt;Using this code I am able to generate a table for IIS Application Pool specific errors. With the eval-case providing a little info about the EventCode. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(host=stwweb0* NOT host=stwweb0*I) sourcetype=WinEventLog:System SourceName="Microsoft-Windows-WAS"  NOT 5186 | rex field=Message "(?i) pool (?P&amp;lt;Pool&amp;gt;[^ ]+)" |eval EventNumber=case(EventCode=5009 ,"5009 Terminated Unexpectedly",EventCode=5011,"5011 Communication Error",EventCode=5012,"5012 exceeded time limits during start up",EventCode=5013,"5013, exceeded time limits during shut down" ,EventCode=5014,"5014, internal error in its process management",EventCode=5074,"5074, worker process reached its allowed processing time limit",EventCode=5079,"5079, An administrator has requested a recycle",EventCode=5076,"5076, scheduled recycle time",EventCode=5138,"5138, failed to stop a listener channel for protocol 'http' in the allotted time",EventCode=5080,"5080, Recycled due to system settings change",EventCode=5010,"5010 Ping Timeout") |stats count by EventCode Pool EventNumber|eval Pool=Pool."-".count | stats list(Pool) as "Pool Count" by EventCode EventNumber
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This returns a happy little list. &lt;BR /&gt;
The problem is if there is no specific eval-case statement for the EventCode it gets dropped from the table output. I am looking for a way to still return Pool and EventCode even if no EventNumber exists. OR, the lump all non-specified EventCodes into an "Other" category. &lt;/P&gt;

&lt;P&gt;Any help is appreciated, Thanks in advance!  JD&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/534i2F04D64DC502789D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Aug 2015 18:17:32 GMT</pubDate>
    <dc:creator>JDukeSplunk</dc:creator>
    <dc:date>2015-08-04T18:17:32Z</dc:date>
    <item>
      <title>Use EVAL and Case for Windows EventCodes to provide information in table output.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-EVAL-and-Case-for-Windows-EventCodes-to-provide-information/m-p/160675#M45434</link>
      <description>&lt;P&gt;Using this code I am able to generate a table for IIS Application Pool specific errors. With the eval-case providing a little info about the EventCode. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(host=stwweb0* NOT host=stwweb0*I) sourcetype=WinEventLog:System SourceName="Microsoft-Windows-WAS"  NOT 5186 | rex field=Message "(?i) pool (?P&amp;lt;Pool&amp;gt;[^ ]+)" |eval EventNumber=case(EventCode=5009 ,"5009 Terminated Unexpectedly",EventCode=5011,"5011 Communication Error",EventCode=5012,"5012 exceeded time limits during start up",EventCode=5013,"5013, exceeded time limits during shut down" ,EventCode=5014,"5014, internal error in its process management",EventCode=5074,"5074, worker process reached its allowed processing time limit",EventCode=5079,"5079, An administrator has requested a recycle",EventCode=5076,"5076, scheduled recycle time",EventCode=5138,"5138, failed to stop a listener channel for protocol 'http' in the allotted time",EventCode=5080,"5080, Recycled due to system settings change",EventCode=5010,"5010 Ping Timeout") |stats count by EventCode Pool EventNumber|eval Pool=Pool."-".count | stats list(Pool) as "Pool Count" by EventCode EventNumber
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This returns a happy little list. &lt;BR /&gt;
The problem is if there is no specific eval-case statement for the EventCode it gets dropped from the table output. I am looking for a way to still return Pool and EventCode even if no EventNumber exists. OR, the lump all non-specified EventCodes into an "Other" category. &lt;/P&gt;

&lt;P&gt;Any help is appreciated, Thanks in advance!  JD&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/534i2F04D64DC502789D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 18:17:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-EVAL-and-Case-for-Windows-EventCodes-to-provide-information/m-p/160675#M45434</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2015-08-04T18:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Use EVAL and Case for Windows EventCodes to provide information in table output.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-EVAL-and-Case-for-Windows-EventCodes-to-provide-information/m-p/160676#M45435</link>
      <description>&lt;P&gt;Just add a default value condition in the eval-case of yours, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(host=stwweb0* NOT host=stwweb0*I) sourcetype=WinEventLog:System SourceName="Microsoft-Windows-WAS"  NOT 5186 | rex field=Message "(?i) pool (?P&amp;lt;Pool&amp;gt;[^ ]+)" |eval EventNumber=case(EventCode=5009 ,"5009 Terminated Unexpectedly",EventCode=5011,"5011 Communication Error",EventCode=5012,"5012 exceeded time limits during start up",EventCode=5013,"5013, exceeded time limits during shut down" ,EventCode=5014,"5014, internal error in its process management",EventCode=5074,"5074, worker process reached its allowed processing time limit",EventCode=5079,"5079, An administrator has requested a recycle",EventCode=5076,"5076, scheduled recycle time",EventCode=5138,"5138, failed to stop a listener channel for protocol 'http' in the allotted time",EventCode=5080,"5080, Recycled due to system settings change",EventCode=5010,"5010 Ping Timeout",1=1,"Other") |stats count by EventCode Pool EventNumber|eval Pool=Pool."-".count | stats list(Pool) as "Pool Count" by EventCode EventNumber
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2015 19:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-EVAL-and-Case-for-Windows-EventCodes-to-provide-information/m-p/160676#M45435</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-04T19:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Use EVAL and Case for Windows EventCodes to provide information in table output.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-EVAL-and-Case-for-Windows-EventCodes-to-provide-information/m-p/160677#M45436</link>
      <description>&lt;P&gt;That got it 1=1,"Google It".  &lt;/P&gt;

&lt;P&gt;Pasting my cleaned up version of this in case someone else needs to monitor App Pools the way we do. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype=WinEventLog:System SourceName="Microsoft-Windows-WAS"  NOT 5186 NOT 5076 | rex field=Message "(?i) pool (?P&amp;lt;Pool&amp;gt;[^ ]+)"|eval Description=case(EventCode=5009 ,"Terminated Unexpectedly",EventCode=5011,"Communication Error",EventCode=5013,"Exceeded time during shut down" ,EventCode=5074,"Exceeded allowed processing time",EventCode=5079,"Administrator recycle",EventCode=5076,"Scheduled recycle time",EventCode=5080,"Pool settings changed",EventCode=5010,"Ping Timeout",1=1,"Google It..") |stats count by EventCode Description Pool
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2015 20:54:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-EVAL-and-Case-for-Windows-EventCodes-to-provide-information/m-p/160677#M45436</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2015-08-04T20:54:43Z</dc:date>
    </item>
  </channel>
</rss>

