Skip to content

Instantly share code, notes, and snippets.

View jsirianni's full-sized avatar

Joseph Sirianni jsirianni

  • observIQ, Inc
  • Grand Rapids Michigan
View GitHub Profile
receivers:
iis:
collection_interval: 30s
hostmetrics:
collection_interval: 30s
scrapers:
cpu:
disk:
load:
# HTTP input to file_output
#
# Test with:
# curl -v localhost:9090 -XPOST -d '{"message":"hello world"}'
#
pipeline:
- type: http_input
listen_address: 0.0.0.0:9090
# uncomment to enable basic auth
# TCP input to file_output
#
# Test with nc or netcat:
# echo "hello world" | nc localhost 9000
#
pipeline:
- type: tcp_input
listen_address: 0.0.0.0:9000
# remove `add_labels` to omit the following labels:
# net.host.ip, net.host.port, net.peer.ip, net.peer.port, net.transport
# UDP input to file_output
#
# Test with nc or netcat:
# echo "hello world" | nc -u localhost 8000
#
pipeline:
- type: udp_input
listen_address: 0.0.0.0:8000
# remove `add_labels` to omit the following labels:
# net.host.ip, net.host.port, net.peer.ip, net.peer.port, net.transport
@jsirianni
jsirianni / haproxy_filter.yaml
Last active October 11, 2021 18:43
HAProxy filter out 200, 300
- expr: $$body.status == "200" or $$body.status == "302" or $$body.status == "304" or $$body.status == "301"
type: filter
- type: udp_input
listen_address: '0.0.0.0:514'
labels:
plugin_id: custom
add_labels: true
- id: syslog_regex_priority_parser
type: regex_parser
if: '$record matches "^<\\d+>.*"'
regex: '^<(?P<priority>[\d]+)>(?P<timestamp>\w{3}\s\d{2}\s\d{2}:\d{2}:\d{2})\s+(?P<hostname>[^\s]+)\s+(?P<protocol>[^\(]+)\((?P<port>[^\)]+)\)\s+Data:\s+(?P<message>.*)'
parse_from: $record
@jsirianni
jsirianni / config.yaml
Created August 12, 2021 18:02
Stanza GCP File Input Example
pipeline:
- type: file_input
include:
- /root/test.log
- /root/test2.log
- /root/log/*
exclude:
- '/root/log/*.gz'
# On first startup, start at the end of each file (do not read
# old logs). The agent will pickup where it left off if stopped
@jsirianni
jsirianni / gist:36aaf78efbe72eccf80eed8ef5b85e03
Created August 12, 2021 18:02
stanza file input on gcp example
pipeline:
- type: file_input
include:
- /root/test.log
- /root/test2.log
- /root/log/*
exclude:
- '/root/log/*.gz'
# On first startup, start at the end of each file (do not read
# old logs). The agent will pickup where it left off if stopped
package tcp
import (
"fmt"
"context"
"net"
"sync"
"github.com/observiq/stanza/entry"
"github.com/observiq/stanza/errors"
@jsirianni
jsirianni / cleanup.sh
Created February 17, 2020 16:33 — forked from superseb/cleanup.sh
Cleanup host added as custom to Rancher 2.0
#!/bin/sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done