<?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 syslog priority/level not logged? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/syslog-priority-level-not-logged/m-p/53810#M10380</link>
    <description>&lt;PRE&gt;
Is there any way to distinguish the various priorities/levels of syslogged messages when viewed from Splunk?
I don't see a field that will distinguish the following messages: 

logger -t MYTAG -p local1.emerg Testing facility and priority/level.
logger -t MYTAG -p local1.alert Testing facility and priority/level.
logger -t MYTAG -p local1.crit Testing facility and priority/level.
logger -t MYTAG -p local1.err Testing facility and priority/level.
logger -t MYTAG -p local1.warning Testing facility and priority/level.
logger -t MYTAG -p local1.notice Testing facility and priority/level.
logger -t MYTAG -p local1.info Testing facility and priority/level.
logger -t MYTAG -p local1.debug Testing facility and priority/level.
&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Jan 2012 19:47:04 GMT</pubDate>
    <dc:creator>NK_1</dc:creator>
    <dc:date>2012-01-18T19:47:04Z</dc:date>
    <item>
      <title>syslog priority/level not logged?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/syslog-priority-level-not-logged/m-p/53810#M10380</link>
      <description>&lt;PRE&gt;
Is there any way to distinguish the various priorities/levels of syslogged messages when viewed from Splunk?
I don't see a field that will distinguish the following messages: 

logger -t MYTAG -p local1.emerg Testing facility and priority/level.
logger -t MYTAG -p local1.alert Testing facility and priority/level.
logger -t MYTAG -p local1.crit Testing facility and priority/level.
logger -t MYTAG -p local1.err Testing facility and priority/level.
logger -t MYTAG -p local1.warning Testing facility and priority/level.
logger -t MYTAG -p local1.notice Testing facility and priority/level.
logger -t MYTAG -p local1.info Testing facility and priority/level.
logger -t MYTAG -p local1.debug Testing facility and priority/level.
&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jan 2012 19:47:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/syslog-priority-level-not-logged/m-p/53810#M10380</guid>
      <dc:creator>NK_1</dc:creator>
      <dc:date>2012-01-18T19:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: syslog priority/level not logged?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/syslog-priority-level-not-logged/m-p/53811#M10381</link>
      <description>&lt;P&gt;This question and answer might prove useful: &lt;A href="http://splunk-base.splunk.com/answers/31036/syslog-facility-and-severity-loglevel"&gt;http://splunk-base.splunk.com/answers/31036/syslog-facility-and-severity-loglevel&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2012 21:04:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/syslog-priority-level-not-logged/m-p/53811#M10381</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-01-18T21:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: syslog priority/level not logged?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/syslog-priority-level-not-logged/m-p/53812#M10382</link>
      <description>&lt;P&gt;The information is in the event, so you just need to "teach" Splunk how to see it.&lt;/P&gt;

&lt;P&gt;The easiest way is to use the interactive field extractor (search for "extract fields" in the User Manual). If that isn't successful then find the extractions in props.conf (probably under $SPLUNK_HOME/etc/users/MyUserName/AppName/Local) and tweak them. They might look something like this (after tweaking):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype_name]
EXTRACT-SyslogFacility = (?i)^.*-p\s(?P&amp;lt;Facility&amp;gt;[^\.]*)
EXTRACT-SyslogSeverity = (?i)^.*-p\s\W*\.(?P&amp;lt;Severity&amp;gt;[^\s]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There are umpteen different ways to extract the same data with regexes and I'm no guru so hopefully someone else can provide some tips on optimising this. For a start you could merge them into one extraction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EXTRACT-SyslogFacSev = (?i)^.*-p\s(?P&amp;lt;Facility&amp;gt;[^\.]*)\.(?P&amp;lt;Severity&amp;gt;[^\s]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This regex says:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;(?i)&lt;/CODE&gt; = ignore case&lt;/LI&gt;
&lt;LI&gt;^ = beginning
of line&lt;/LI&gt;
&lt;LI&gt;.* = any amount of any
character&lt;/LI&gt;
&lt;LI&gt;-p = "-p"&lt;/LI&gt;
&lt;LI&gt;\s = one
whitespace&lt;/LI&gt;
&lt;LI&gt;(?P&lt;FACILITY&gt;[^.]*) = capture any characters up to the next
"." and call them "Facility"&lt;/FACILITY&gt;&lt;/LI&gt;
&lt;LI&gt;. = "."&lt;/LI&gt;
&lt;LI&gt;(?P&lt;SEVERITY&gt;[^\s]*) = capture
any characters up to the next
whitespace and call them "Facility"&lt;/SEVERITY&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;You could also use "alternatives," where you list all of the possible options that could be the  facility or priority, but I'm not sure if that would be any more efficient.&lt;/P&gt;

&lt;P&gt;I find Expresso really handy for learning about and testing regexes. Just remember to add the "P" in to the capture group when you paste it into props.conf&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2012 23:13:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/syslog-priority-level-not-logged/m-p/53812#M10382</guid>
      <dc:creator>FunPolice</dc:creator>
      <dc:date>2012-01-18T23:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: syslog priority/level not logged?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/syslog-priority-level-not-logged/m-p/53813#M10383</link>
      <description>&lt;P&gt;Yes. That answer tells you about no_priority_stripping, which you will need to set in your inputs.conf for that udp input, in order to get the priority field.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:20:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/syslog-priority-level-not-logged/m-p/53813#M10383</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2020-09-28T13:20:43Z</dc:date>
    </item>
  </channel>
</rss>

