For syslog, I named all of the hosts nxfilter-<something> and match on that. The syntax using rsyslog to send these to port 1234 on my logstash server:
:HOSTNAME, contains, "nxfilter" @logstash:1234
All of the messages start with a timestamp and |Y| or |N|, so if you prefer regular expressions something like should work well (untested)
:msg, regex, ^[0-9\ -:]*|[YN]| @logstash:1234
Jinhee, a good option would be to add a syslog tag as recommended in section 5.3 of RFC 3164 (
https://tools.ietf.org/html/rfc3164#section-5.3)
That would give us something easy to match on without changing the log message content itself. For example if a syslog tag of "NXFILTER" was set, the resulting log entry would look like this:
Feb 23 06:30:05
myserver.domain.com NXFILTER: 2015-02-23 06:30:05|N|
www.google.com|Default|1.2.3.4|Default|searchengines||28
which can be matched in rsyslog.conf with:
:syslogtag, contains, "NXFILTER" @logstash:1234
-Eric