Skip to content

Instantly share code, notes, and snippets.

@robinsmidsrod
robinsmidsrod / logstash.conf
Created December 5, 2012 13:01
Logging Windows event log information to Logstash using nxlog and JSON transport
input {
tcp {
type => "syslog"
host => "127.0.0.1"
port => 3514
}
tcp {
type => "eventlog"
host => "10.1.1.2"
port => 3515
@thepaul
thepaul / saferscanner.py
Created October 24, 2011 19:18
safer version of python's re.Scanner
# SaferScanner is just like re.Scanner, but it neuters any grouping in the lexicon
# regular expressions and throws an error on group references, named groups, or
# regex in-pattern flags. Any of those can break correct operation of Scanner.
import re
from sre_constants import BRANCH, SUBPATTERN, GROUPREF, GROUPREF_IGNORE, GROUPREF_EXISTS
class SaferScanner(re.Scanner):
def __init__(self, lexicon, flags=0):
self.lexicon = lexicon