Skip to content

Instantly share code, notes, and snippets.

View anthonygtellez's full-sized avatar

Anthony Tellez anthonygtellez

View GitHub Profile
@version:3.2
# ===============================================================================================
# Configuration file for syslog-ng, customized for remote logging
# ===============================================================================================
# Options
# Note about $HOST / HOST
# Description: The name of the source host where the message originates from.
# If the message traverses several hosts and the chain_hostnames() option is on, the first host in the chain is used.
# If the keep_hostname() option is disabled (keep_hostname(no)), the value of the $HOST macro will be the DNS hostname of the host that sent the message to syslog-ng OSE (that is, the DNS hostname of the last hop). In this case the $HOST and $HOST_FROM macros will have the same value.
@anthonygtellez
anthonygtellez / syslog-ng.conf
Last active September 21, 2023 19:51
syslog-ng filter by port, create a folder for daily message
@version:3.2
# ===============================================================================================
# Configuration file for syslog-ng, customized for remote logging
# ===============================================================================================
# Options
# Note about $HOST / HOST
# Description: The name of the source host where the message originates from.
# If the message traverses several hosts and the chain_hostnames() option is on, the first host in the chain is used.
# If the keep_hostname() option is disabled (keep_hostname(no)), the value of the $HOST macro will be the DNS hostname of the host that sent the message to syslog-ng OSE (that is, the DNS hostname of the last hop). In this case the $HOST and $HOST_FROM macros will have the same value.
@anthonygtellez
anthonygtellez / setdefaultoken.js
Created June 1, 2015 05:12
Set Default token in splunk on page load
require(['splunkjs/ready!'], function(mvc) {
var tokens = mvc.Components.get('default');
tokens.set('myToken', 'initialValue');
});
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
<form script="custom_vizs:autodiscover.js" stylesheet="dark.css">
<label>USC SourceFire Geographical Intelligence</label>
<fieldset submitButton="true">
<input type="time" token="v_time" searchWhenChanged="true">
<label>Time</label>
<default>
<earliest>-24h@h</earliest>
<latest>now</latest>
</default>
</input>
Install EPEL for the addiitonal YUM Repos:
$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Use yum to install the rpm into the local system:
$ yum locallinstall epel-release-latest-7.noarch.rpm
Syslog-ng requires the libnet dependency:
@anthonygtellez
anthonygtellez / cidr2regex.py
Created December 7, 2015 23:21 — forked from waffle2k/cidr2regex.py
Convert CIDR notation to regex
#!/usr/bin/python
''' Not my script, found on the Internet, and rediscovered on my hard drive
'''
import sys
def cidr_to_regex(cidr):
ip, prefix = cidr.split('/')
base = 0
for val in map(int, ip.split('.')):
@anthonygtellez
anthonygtellez / gist:4a309f277d8c162addaa184ab4853bd0
Created May 23, 2016 21:31 — forked from bortzmeyer/gist:1284249
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys
# found on the internet, not my creation
# - jsie
import re
total_logical_cpus = 0
total_physical_cpus = 0
total_cores = 0
logical_cpus = {}
#!/bin/bash
#
# ===========================================================
# Purpose: This script will install splunk and complete some initial setup steps
# Parameters: None
# Example usage: $ bash rhel_yum_install_syslog-ng.sh
#
# Privileges: Must be run as root
# Author: Anthony Tellez
#