Skip to content

Instantly share code, notes, and snippets.

View ltudury's full-sized avatar

Leila Tudury ltudury

View GitHub Profile
@ltudury
ltudury / LogglySenderv0.1.sh
Created January 14, 2012 00:23
LogglySender
#!/usr/local/bin/perl
#---------
# LogglySender v0.1
# Sends log lines from Apache to Loggly via an HTTP input
# http://wiki.loggly.com/
#---------
# IMPORTANT: Be sure to make this script executable!
# (e.g. "chmod +x logglysender.pl")
#---------
use LWP::UserAgent;
@ltudury
ltudury / inputDiscovery.py
Created January 18, 2012 00:55
Automatic Device Discovery
import json
import sys
import urllib2
'''
Auto-authenticate Syslog TCP inputs.
Usage: python inputs.py -u user -p pass -s subdomain
'''
state = None
@ltudury
ltudury / gist:1636513
Created January 18, 2012 23:30
HTTP Input: JSON output
{
"name": "httptest",
"service": {
"name": "HTTP",
"display": "HTTP"
},
"created": "2011-01-07 19:41:33",
"input_token": "9076bdc4-9ed7-403a-9c85-f02da2404054",
"id": 337,
"description": "This is an HTTP input"
@ltudury
ltudury / gist:1636518
Created January 18, 2012 23:31
Input Request: JSON output
{
"name": "myinput",
"service": {
"name": "syslogtcp",
"display": "Syslog TCP"
},
"created": "2011-02-10 19:05:06",
"discover": true,
"discover_time": "2011-02-10 19:05:06",
"id": 416,
@ltudury
ltudury / gist:1636524
Created January 18, 2012 23:31
Device: JSON output
[
{
"name": "",
"ip": "24.4.108.196",
"input": [
{
"name": "zoto",
"id": 248
},
{
@ltudury
ltudury / gist:1636489
Created January 18, 2012 23:24
Loggly Search: JSON output
{
"data": [
{
"timestamp": "2010-02-17 02:08:45.912-0700",
"inputname": "solrclient",
"ip": "127.0.0.1",
"text": "btpool0-87 SolrCore.execute INFO: [repo_6] webapp=/solr path=/select/ params={sort=timestamp+desc&start=0&q=404&version=2.2&rows=100} hits=7182 status=0 QTime=0 \n",
},
{
"timestamp": "2010-02-17 02:08:29.123-0700",
@ltudury
ltudury / gist:1636674
Created January 19, 2012 00:10
Loggly Custom Command Structure
loggly.bark.external_command({ /*VERY IMPORTANT, this is what allows your command to be loaded */
CommandName: { /*Towards the beginning when you used colormodified.js example...this was labeled **change** */
run: function ( args, stdin, context ) {
/* what you want your command to do with piped parameters */
}
}
});
@ltudury
ltudury / gist:1636505
Created January 18, 2012 23:28
Facet JSON output
{
"numFound": 1484,
"gap": "+30MINUTES",
"gmt_offset": "-0700",
"start": 0,
"context": {
"rows": null,
"from": "NOW-1DAY/HOUR",
"until": "NOW+1HOUR/HOUR",
"start": 0,
@ltudury
ltudury / gist:1636509
Created January 18, 2012 23:29
Input: JSON output
[
{
"name": "syslog",
"service": {
"name": "syslogudp",
"display": "Syslog UDP"
},
"created": "2010-09-09 20:19:47",
"discover": false,
"discover_time": "2010-10-25 20:30:56",
@ltudury
ltudury / syslog_with_stripping
Created March 15, 2012 21:21
Syslog Example Logs
uc_insert: Value too old: name =  i-d55fbbbe/df/df-dev-shm; value time = 1266363202; last cache update =  1266363202;