Skip to content

Instantly share code, notes, and snippets.

@MrBasset
MrBasset / gist:368aa587da5b3bc9c4c5
Last active October 6, 2016 09:57
A very quick and dirty implementation of an xpath filter for ansible.
#/usr/bin/python
# By Dan Pool
# Custom filter for parsing XML variables using xpath
from functools import partial
from io import BytesIO
try:
from lxml import etree
import lxml
@MrBasset
MrBasset / log-reader.ps1
Last active August 29, 2015 14:23 — forked from sean-m/log-reader-config.ps1
Forked from sean-m/log-reader-config.ps1. I changed the script so that logstash-forwarder is started as a process and the json event messages are pushed to the stdin of logstash-forwarder. I don't know how this will be affected by network connectivity, but it means I don't need to worry about a log file on the C: drive growing ever larger.
#Requires -Version 3
param (
[string]$lognames
)
#reading security log requires elevated privileges so only read Application and System for now
[string[]]$logname = $("Application", "System" )
if ($lognames)
{