<?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 do I extract syslog code to carry out a lookup and create new indexed fields for syslog facility and severity? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-syslog-code-to-carry-out-a-lookup-and-create/m-p/250946#M99178</link>
    <description>&lt;P&gt;"What I want to do is use the syslog code to do a lookup against a csv to find the matching facility and severity and have the 2 values included as indexed fields within Splunk indexer."&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Lookups only happen at search time. Therefore, you can't put the lookup configuration on a forwarder (well, you &lt;EM&gt;can&lt;/EM&gt;, but it doesn't do anything). The lookup should be configured on the search head (or the indexer if you don't have a separate search head). This also means that you can't index the result of a lookup.&lt;/LI&gt;
&lt;LI&gt;In general (which means 99.99% of the time), index-time fields are a bad idea in Splunk. I know that this is completely counter-intuitive, but it is true. Make your lookup automatic and it will provide the additional fields at search time; to the user, it will appear that these fields are indexed.&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Thu, 17 Mar 2016 17:59:39 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2016-03-17T17:59:39Z</dc:date>
    <item>
      <title>How do I extract syslog code to carry out a lookup and create new indexed fields for syslog facility and severity?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-syslog-code-to-carry-out-a-lookup-and-create/m-p/250945#M99177</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I'm running Splunk 5.0.4. In the environment I have 2 servers&lt;BR /&gt;
deploy/heavy forwarder&lt;BR /&gt;
Search head/indexer.&lt;/P&gt;

&lt;P&gt;On the heavy forwarder I have setup the listener for syslog udp:514&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;C:\Program Files\Splunk\etc\system\local\inputs.conf
[udp://514]
connection_host = dns
sourcetype = syslog
no_priority_stripping = true
no_appending_timestamp = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is working and forwarding on the syslog events to the indexer and the syslog code is being included but the timestamp is still being included also eg - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;189&amp;gt;: 2016 Mar 17 09:08:18.325 gmt
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I want to do is use the syslog code &amp;lt;189&amp;gt; to do a lookup against a csv to find the matching facility and severity and have the 2 values included as indexed fields within Splunk indexer.&lt;/P&gt;

&lt;P&gt;I have atempted to do this by including the following on the Heavy Forwarder (Is this the correct place and server??)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;C:\Program Files\Splunk\etc\apps\Aggregator_f\local\props.conf
[source::udp:514]
EXTRACT-extractSyslogcode = (?i)^&amp;lt;(?P&amp;lt;syslog_code&amp;gt;[^&amp;gt;]+)
LOOKUP-SyslogCode = syslog_facility_severity_codes code AS syslog_code OUTPUTNEW facility AS sys_facility, severity AS sys_severity

C:\Program Files\Splunk\etc\apps\Aggregator_f\local\transforms.conf
[syslog_facility_severity_codes]
filename = syslog-codes.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The csv file for the lookup is located in&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;C:\Program Files\Splunk\etc\apps\Health_Aggregator_f\lookups\syslog-codes.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If anyone can provide any assistance with this it would be greatly received.&lt;/P&gt;

&lt;P&gt;thanks&lt;BR /&gt;
Steve&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 10:36:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-syslog-code-to-carry-out-a-lookup-and-create/m-p/250945#M99177</guid>
      <dc:creator>corners</dc:creator>
      <dc:date>2016-03-17T10:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract syslog code to carry out a lookup and create new indexed fields for syslog facility and severity?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-syslog-code-to-carry-out-a-lookup-and-create/m-p/250946#M99178</link>
      <description>&lt;P&gt;"What I want to do is use the syslog code to do a lookup against a csv to find the matching facility and severity and have the 2 values included as indexed fields within Splunk indexer."&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Lookups only happen at search time. Therefore, you can't put the lookup configuration on a forwarder (well, you &lt;EM&gt;can&lt;/EM&gt;, but it doesn't do anything). The lookup should be configured on the search head (or the indexer if you don't have a separate search head). This also means that you can't index the result of a lookup.&lt;/LI&gt;
&lt;LI&gt;In general (which means 99.99% of the time), index-time fields are a bad idea in Splunk. I know that this is completely counter-intuitive, but it is true. Make your lookup automatic and it will provide the additional fields at search time; to the user, it will appear that these fields are indexed.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 17 Mar 2016 17:59:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-syslog-code-to-carry-out-a-lookup-and-create/m-p/250946#M99178</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-03-17T17:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract syslog code to carry out a lookup and create new indexed fields for syslog facility and severity?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-syslog-code-to-carry-out-a-lookup-and-create/m-p/250947#M99179</link>
      <description>&lt;P&gt;Thanks for replying.&lt;BR /&gt;
I did move the settings over to the indexer yesterday after further reading around lookups.&lt;BR /&gt;
This has resulted in the additional fields being generated at search time.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2016 09:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-extract-syslog-code-to-carry-out-a-lookup-and-create/m-p/250947#M99179</guid>
      <dc:creator>corners</dc:creator>
      <dc:date>2016-03-18T09:27:48Z</dc:date>
    </item>
  </channel>
</rss>

