Skip to content

Instantly share code, notes, and snippets.

@jseiser
jseiser / fb.yaml
Created July 18, 2023 16:12
Fluent Bit Config Map
custom_parsers.conf: |
[PARSER]
Name syslog
Format regex
Regex ^(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$
Time_Key time
Time_Format %b %d %H:%M:%S
[PARSER]
Name container_firstline
apiVersion: karpenter.sh/v1alpha5
kind: Provisioner
metadata:
name: default
namespace: karpenter
spec:
consolidation:
enabled: true
ttlSecondsUntilExpired: 2592000
weight: 10
@jseiser
jseiser / gist:1b42f103de868b51924e3fddac5471fa
Created March 24, 2021 22:56
Get URLS of Ball Chase Rocket League Replays by Certain Pros
import requests
headers = {'Authorization': 'TOKEN_HERE'}
payload = {'playlist': 'ranked-duels', 'pro': 'true'}
r = requests.get('https://ballchasing.com/api/replays', params=payload, headers=headers)
jsonResponse = r.json()
PROS = ['AYYJAY', 'Daniel', 'Wizz']
for replay in jsonResponse['list']:
@jseiser
jseiser / app.py
Last active February 25, 2021 14:39
Delete Empty Cloudwatch Log Groups
#!/usr/bin/env python3
import botocore
from botocore.config import Config
import boto3
config = Config(retries=dict(max_attempts=10))
client = boto3.client("logs", config=config)
@jseiser
jseiser / README.md
Created June 26, 2018 17:08 — forked from iMilnb/README.md
AWS Terraform configuration: Stream CloudWatch Logs to ElasticSearch

Rationale

This snippet is a sample showing how to implement CloudWatch Logs streaming to ElasticSearch using terraform. I wrote this gist because I didn't found a clear, end-to-end example on how to achieve this task. In particular, I understood the resource "aws_lambda_permission" "cloudwatch_allow" part by reading a couple of bug reports plus this stackoverflow post.

The js file is actually the Lambda function automatically created by AWS when creating this pipeline through the web console. I only added a endpoint variable handling so it is configurable from terraform.

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AWSCloudTrailCreateLogStream2014110",
"Effect": "Allow",
"Action": [
"logs:CreateLogStream"
],