Skip to content

Instantly share code, notes, and snippets.

Leon Sodhi leonsodhi

  • UK
Block or report user

Report or block leonsodhi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View log_to_pt.py
import logging
import socket
from logging.handlers import SysLogHandler
class ContextFilter(logging.Filter):
hostname = socket.gethostname()
def filter(self, record):
record.hostname = ContextFilter.hostname
View papertrail-fastly-vcl.vcl
# Called at the beginning of a request, after the complete request has been received and parsed
sub vcl_recv {
#FASTLY recv
if (req.request != "HEAD" && req.request != "GET" && req.request != "FASTLYPURGE") {
return(pass);
}
return(lookup);
}
View 01papertrail.config
# IMPORTANT: this example is potentially out of date. The latest version can be found here: https://github.com/papertrail/remote_syslog2/blob/master/examples/remote_syslog.ebextensions.config
# See http://help.papertrailapp.com/kb/hosting-services/aws-elastic-beanstalk/
# Usage:
# - replace <VERSION> with the version of remote_syslog2 you want to use. Example: .../download/v0.14/remote_syslog_linux_amd64.tar.gz
# - replace <YOUR-TRACKED-FILES> with the files you want to monitor for new log lines. Example: - /var/log/httpd/access_log
# - replace <YOUR-APP-NAME> with the name of the application
# - replace <YOUR-LOG-DESTINATION> and <YOUR-PORT-NUMBER> with the values shown under log destinations: https://papertrailapp.com/account/destinations
sources:
View 01papertrail.config
# Credits:
# Jason Pirkey, Táve Corporation, http://www.tave.com/
# Jeremy Mickelson, https://github.com/CyborgMaster
# Richard Smith, iCaseWork Ltd, http://www.icasework.com/
# See http://help.papertrailapp.com/kb/hosting-services/amazon-elastic-beanstalk
packages:
yum:
rubygems: []
View nxlog_config_linux_TLS_file_monitoring_template.conf
########################################
# Global directives #
########################################
User nxlog
Group nxlog
LogFile /var/log/nxlog/nxlog.log
LogLevel INFO
########################################
View nxlog_config_template.conf
## Please set the ROOT to your nxlog installation directory
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log
View 01papertrail.config
# Credit: Jason Pirkey, Táve Corporation, http://www.tave.com/
# See http://help.papertrailapp.com/kb/hosting-services/amazon-elastic-beanstalk
packages:
yum:
rubygems: []
ruby-devel: []
openssl-devel: []
rubygems:
You can’t perform that action at this time.