<?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: Filtering syslog  HaProxy 200 status Logs in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325246#M60495</link>
    <description>&lt;P&gt;I attempted the props.conf and tranforms.conf fix on my indexers to no avail. All logs are still coming through, unless my REGEX of 200 inst actually finding the ' 200 ' string that is in the haproxy log. &lt;/P&gt;

&lt;P&gt;My rsyslog haproxy config looks like this. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ModLoad imudp

#Opens Port 514 to listen for haproxy messages
$UDPServerAddress 127.0.0.1
$UDPServerRun 514
$template Haproxy, "msg%n"

if $programname startswith 'haproxy' then /var/log/haproxy.log

#Defines the http log will be saved in haproxy.log
#Logs Everything
local0.=info -/var/log/haproxy.log;HaProxy
#Keeps logs in local host
local0.* ~
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have attempted to filter by $msg contains ' 200 ' in the RainerScript but it seems to filter out everything when I do so. &lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2017 14:24:11 GMT</pubDate>
    <dc:creator>jkostovich</dc:creator>
    <dc:date>2017-09-07T14:24:11Z</dc:date>
    <item>
      <title>How to filter syslog  HaProxy 200 status Logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325240#M60489</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I currently need to filter out some logs from our HaProxy Server. Have a UniversalForwarder installed on the haproxy box and it is currently logging everything locally through syslog to /var/log/haproxy.log&lt;/P&gt;
&lt;P&gt;It is logging all 200 logs which generate thousands of logs an hour which we dont need. I have tried creating a props and transform to do this as follows. I am possibly not placing them in the right location?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;props.conf 

[sourcetype::/var/log/haproxy.log]
TRANSFORM-null = setnull

transform.conf

[setnull]
REGEX =  200 #Looking for the string 200 in the log
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I thought putting this on the indexers would then filter out all logs with "200" in them, but it did nothing.&lt;/P&gt;
&lt;P&gt;Next I tried editing the haproxy syslog config itself.&lt;/P&gt;
&lt;P&gt;When I added the following code it completely killed all log flow, not just 200.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;if ( \
      $programname contains 'haproxy' and \
      not ($msg contains ' 200 ' ) \
   )
then -/var/log/haproxy.log
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;These are the two solutions, editing the rsyslog config and creating transforms and props edits, that are most advertised in my searches as solutions but I cannot seem to get them to work.&lt;/P&gt;
&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 17:33:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325240#M60489</guid>
      <dc:creator>jkostovich</dc:creator>
      <dc:date>2022-07-25T17:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog  HaProxy 200 status Logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325241#M60490</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;"I am possibly not placing them in the right location?"&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;From &lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Forwarding/Routeandfilterdatad"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Forwarding/Routeandfilterdatad&lt;/A&gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;"You can configure routing only on a heavy forwarder. "&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;If you placed the filtering-configuration on your Universal Forwarder that is the wrong place since the UF does not parse the data. In other words it 's not looking into your data and applying your transformation. &lt;/P&gt;

&lt;P&gt;You have to place the configuration on the first splunk-system thats acutaly parsing, which is most likely your indexer. &lt;/P&gt;

&lt;P&gt;Sincerely&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 11:03:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325241#M60490</guid>
      <dc:creator>hgrow</dc:creator>
      <dc:date>2017-09-07T11:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog  HaProxy 200 status Logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325242#M60491</link>
      <description>&lt;P&gt;The props and transforms can go on the indexer or a heavy forwarder because both support sending to nullQueue. &lt;/P&gt;

&lt;P&gt;See this: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Routeandfilterdatad#Filter_event_data_and_send_to_queues"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Routeandfilterdatad#Filter_event_data_and_send_to_queues&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However, the major issue i see is that it appears you have an incorrect props.conf, try these settings instead:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [source::/var/log/haproxy.log]
 TRANSFORMS-null = setnull
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note there are two changes... sourcetype becomes source, and TRANSFORM becomes TRANSFORMS.&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [setnull]
 REGEX =  200 
 DEST_KEY = queue
 FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;No difference from what you had.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 11:47:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325242#M60491</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-09-07T11:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog  HaProxy 200 status Logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325243#M60492</link>
      <description>&lt;P&gt;Note according to this: &lt;A href="https://wiki.splunk.com/Community:HowIndexingWorks"&gt;https://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;UFs support nullQueue as well, but most of the other documentation says Queue routing can only be done on a HF or IDX.... your mileage may vary&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 11:57:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325243#M60492</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-09-07T11:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog  HaProxy 200 status Logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325244#M60493</link>
      <description>&lt;P&gt;Regarding placing of the props and transform. Do they go into the haproxy add-on app folder or into the indexers etc/system/local folder?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 13:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325244#M60493</guid>
      <dc:creator>jkostovich</dc:creator>
      <dc:date>2017-09-07T13:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog  HaProxy 200 status Logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325245#M60494</link>
      <description>&lt;P&gt;Beware of the spelling, configuration file name is &lt;CODE&gt;transforms.conf&lt;/CODE&gt; not transform. You could place it inside the add-on created and deploy/install into the Indexer.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 13:48:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325245#M60494</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2017-09-07T13:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog  HaProxy 200 status Logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325246#M60495</link>
      <description>&lt;P&gt;I attempted the props.conf and tranforms.conf fix on my indexers to no avail. All logs are still coming through, unless my REGEX of 200 inst actually finding the ' 200 ' string that is in the haproxy log. &lt;/P&gt;

&lt;P&gt;My rsyslog haproxy config looks like this. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ModLoad imudp

#Opens Port 514 to listen for haproxy messages
$UDPServerAddress 127.0.0.1
$UDPServerRun 514
$template Haproxy, "msg%n"

if $programname startswith 'haproxy' then /var/log/haproxy.log

#Defines the http log will be saved in haproxy.log
#Logs Everything
local0.=info -/var/log/haproxy.log;HaProxy
#Keeps logs in local host
local0.* ~
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have attempted to filter by $msg contains ' 200 ' in the RainerScript but it seems to filter out everything when I do so. &lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 14:24:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325246#M60495</guid>
      <dc:creator>jkostovich</dc:creator>
      <dc:date>2017-09-07T14:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog  HaProxy 200 status Logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325247#M60496</link>
      <description>&lt;P&gt;We have figured out the solution to this. The props and transforms was not working for us so we went to the syslog config and try to filter at the source. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ModLoad imudp

#Opens Port 514 to listen for haproxy messages
$UDPServerAddress 127.0.0.1
$UDPServerRun 514
#$template Haproxy, "msg%n"

:msg, regex, " 200 " ~
local0.=info -/var/log/haproxy.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The regex was the answer to this for us. It is searching for a 200 status code and filtering them out then allowing whats left through to the log file that splunk is monitoring. &lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2017 15:43:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325247#M60496</guid>
      <dc:creator>jkostovich</dc:creator>
      <dc:date>2017-09-07T15:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog  HaProxy 200 status Logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325248#M60497</link>
      <description>&lt;P&gt;The problem was your inlined comment here: &lt;CODE&gt;REGEX =  200 #Looking for the string 200 in the log&lt;/CODE&gt;&lt;BR /&gt;
You must never do that; it was being used as part of your &lt;CODE&gt;REGEX&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Sep 2017 05:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/325248#M60497</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-10T05:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog  HaProxy 200 status Logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/606922#M105411</link>
      <description>&lt;P&gt;Here is how we removed all 200 entries in the haproxy.log. Simply added this line to /etc/rsyslog.conf:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;if ($programname == "haproxy" and not ($msg contains " 200 ")) then /var/log/haproxy.log&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 17:08:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-syslog-HaProxy-200-status-Logs/m-p/606922#M105411</guid>
      <dc:creator>ethan1el</dc:creator>
      <dc:date>2022-07-25T17:08:18Z</dc:date>
    </item>
  </channel>
</rss>

