Skip to content

Instantly share code, notes, and snippets.

View kholisrag's full-sized avatar

Kholis Respati Agum Gumelar kholisrag

  • Indonesia
  • 10:40 (UTC +07:00)
View GitHub Profile
@kholisrag
kholisrag / grok-to-regex.py
Last active August 16, 2024 11:16 — forked from elementalvoid/grok-to-regex.py
Improved grok-to-regex.py to run with python 3.12 and nested grok pattern
#!/usr/bin/env python
import argparse
import re
from os import walk
from os.path import join
def get_patterns(patterns_dir):
patterns = {}
for (dirpath, _, filenames) in walk(patterns_dir):
for name in filenames: