title: rsyslog filtering and forwarding
body: <p>I'm trying to achieve filtering and forwarding using a rsyslog vm.</p>
  <p>When I use</p>
  <pre><code>*.* @@192.168.1.100:514
  </code></pre>
  <p>It forwards all logs to that log server.</p>
  <p>What I need to do is filter out logs that contain 'testing' and 'flow' and also prevent logs from localhost from being sent to the log server.</p>
  <p>I have tried many ways of achieving this combination and failed. I just don't receive any logs to the destination once I use filters.</p>
  <p>The remaining full contents of the rsyslog.conf is</p>
  <pre><code># rsyslog configuration file
  
  # For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
  # If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
  
  #### MODULES ####
  
  # The imjournal module bellow is now used as a message source instead of imuxsock.
  $ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
  $ModLoad imjournal # provides access to the systemd journal
  #$ModLoad imklog # reads kernel messages (the same are read from journald)
  #$ModLoad immark  # provides --MARK-- message capability
  
  # Provides UDP syslog reception
  $ModLoad imudp
  $UDPServerRun 514
  
  # Provides TCP syslog reception
  $ModLoad imtcp
  $InputTCPServerRun 514
  
  #### GLOBAL DIRECTIVES ####
  
  # Where to place auxiliary files
  $WorkDirectory /var/lib/rsyslog
  
  # Use default timestamp format
  $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
  
  # Include all config files in /etc/rsyslog.d/
  $IncludeConfig /etc/rsyslog.d/*.conf
  
  # Turn off message reception via local log socket;
  # local messages are retrieved through imjournal now.
  $OmitLocalLogging on
  
  # File to store the position in the journal
  $IMJournalStateFile imjournal.state
  
  #### RULES ####
  if $msg contains 'testing' then @@192.168.1.100:514
  #*.* @@192.168.1.100:514
  </code></pre>
  <p>My configuration is not working.</p>