Skip to content

Instantly share code, notes, and snippets.

View jalogisch's full-sized avatar
🏠
Working from home

Jan Doberstein jalogisch

🏠
Working from home
View GitHub Profile
@jalogisch
jalogisch / nginx_graylog.conf
Last active August 23, 2017 14:50
Graylog behind NGINX Proxy in a sub-directory
# Graylog in Subdirectorie
#
# server.conf settings:
# rest_listen_uri = http://192.168.10.11:9000/serveurgraylog/api/
# web_listen_uri = http://192.168.10.11:9000/serveurgraylog/
#
server {
listen 80 ;
server_name g1422.lan;
@jalogisch
jalogisch / 0_reuse_code.js
Created February 7, 2017 09:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jalogisch
jalogisch / dns_masq_content_pack.json
Created January 12, 2017 08:53
graylog content pack to use with dnsmasq / pi hole pipeline rules (https://gist.github.com/jalogisch/922b7a3438c5c6f5b9d02557d33ab2eb)
{
"name": "PiHOLE",
"description": "Creates Information Dashboard from pihole with enriched data ( https://gist.github.com/jalogisch/922b7a3438c5c6f5b9d02557d33ab2eb )",
"category": "DNS Intel",
"inputs": [],
"streams": [],
"outputs": [],
"dashboards": [
{
"title": "DNS Intel",
@jalogisch
jalogisch / dnsmasq_clean_message
Last active April 17, 2017 12:04
pi-hole / dnsmasq pipeline rules to use with graylog pipeline rules
rule "dnsmasq clean message"
when
has_field("programname") AND contains(to_string($message.programname), "dnsmasq")
then
let m = regex("^.+: (.+)$", to_string($message.message));
let clean_message = m["0"];
// Set a better message field without the prefix clutter.
set_field("message", clean_message);
end

Keybase proof

I hereby claim:

  • I am jalogisch on github.
  • I am jalogisch (https://keybase.io/jalogisch) on keybase.
  • I have a public key whose fingerprint is A19B F39B 7474 7846 4184 AAFC 70C7 FC35 A4E8 36F8

To claim this, I am signing this object:

@jalogisch
jalogisch / haproxy
Created September 9, 2016 15:32
tcp_syslog_haproxy configuration
listen syslog_tcp_514
bind *:514
mode tcp
timeout client 120s
timeout server 120s
default-server inter 2s downinter 5s rise 3 fall 2 maxconn 64 maxqueue 128 weight 100
server graylog1 192.168.55.201:51400 check
server graylog2 192.168.55.202:51400 check
server graylog3 192.168.55.203:51400 check
@jalogisch
jalogisch / ghost_pipeline_extract_messages
Created August 1, 2016 10:15
this is the pipeline rule to get the information of ghost blog log that is started/monitored by systemd into useful fields in graylog
rule "extract_ghost_blog_from_systemd_log"
when
has_field("programname") AND to_string($message.programname) == "Ghost"
then
let message_field = to_string($message.message);
let action = grok(pattern: "%{COMBINEDAPACHELOG}", value: message_field);
set_fields(action);
end
@jalogisch
jalogisch / jekyll-import.php
Created June 23, 2016 16:58 — forked from tylerhall/jekyll-import.php
Import a Jekyll posts directory into WordPress
<?PHP
require '/path/to/markdown-extra.php';
$db = mysql_connect('localhost', 'root', 'password') or die(mysql_error());
mysql_select_db('tylerio', $db) or die(mysql_error());
$files = scandir('posts');
array_shift($files); // .
array_shift($files); // ..
server
{
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name graylog.example.org;
location /api/
{
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
@jalogisch
jalogisch / Graylog_Extractors_Syslog_Over_AMQP
Last active June 21, 2016 10:35
when using https://gist.github.com/untergeek/0373ee85a41d03ae1b78 to send data via amqp to graylog you some extractor to have your data clean. All after extractor 4 are not needed (but present as i use them for dovecot logs)
{
"extractors": [
{
"title": "1_extract_json_message",
"extractor_type": "json",
"converters": [],
"order": 0,
"cursor_strategy": "copy",
"source_field": "full_message",
"target_field": "",