Skip to content

Instantly share code, notes, and snippets.

@VAdamec
VAdamec / gist:9b25e4453d21851f83e8
Last active August 29, 2015 14:14
Fluentd testing - multimatch not working
httpd.conf
LogFormat "%h %t \"%r\" %>s \"%{User-Agent}i\" %D" perform
CustomLog logs/performance.log perform
td-agent.conf
####
<source>
@VAdamec
VAdamec / gist:1b3f2a32b842fadabd32
Last active August 29, 2015 14:14
Fluentd testing - multimatch with store
httpd.conf
LogFormat "%h %t \"%r\" %>s \"%{User-Agent}i\" %D" perform
CustomLog logs/performance.log perform
td-agent.conf
####
<source>
@VAdamec
VAdamec / record_reformer
Created February 6, 2015 11:52
Testing record_reformer
<source>
type tail
path /var/log/tomcat*/access*
pos_file /var/log/td-agent/tomcat7-access.log.pos
tag Tomcat.access
format /^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] (?<method>\S+)(?: +(?<path>[^ ]*) +\S*)? (?<code>[^ ]*) (?<size>[^ ]*)(?: (?<referer>[^\"]*) (?<agent>[^\"]*))? (?<duration>[^ ]*)?$/
time_format %d/%b/%Y:%H:%M:%S %z
types size:integer,duration:integer
</source>
@VAdamec
VAdamec / fluentd_err
Created February 6, 2015 12:01
Fluentd err
2015-02-06 12:57:49 +0100 [info]: fluent/supervisor.rb:223:supervise: starting fluentd-0.10.55
2015-02-06 12:57:49 +0100 [info]: fluent/supervisor.rb:325:read_config: reading config file path="/etc/td-agent/td-agent.conf"
2015-02-06 12:57:49 +0100 [trace]: fluent/plugin.rb:72:register_impl: registered buffer plugin 'file'
2015-02-06 12:57:49 +0100 [trace]: fluent/plugin.rb:72:register_impl: registered buffer plugin 'memory'
2015-02-06 12:57:49 +0100 [trace]: fluent/plugin.rb:72:register_impl: registered input plugin 'debug_agent'
2015-02-06 12:57:49 +0100 [trace]: fluent/plugin.rb:72:register_impl: registered input plugin 'exec'
2015-02-06 12:57:49 +0100 [trace]: fluent/plugin.rb:72:register_impl: registered input plugin 'forward'
2015-02-06 12:57:49 +0100 [trace]: fluent/plugin.rb:72:register_impl: registered input plugin 'gc_stat'
2015-02-06 12:57:49 +0100 [trace]: fluent/plugin.rb:72:register_impl: registered input plugin 'http'
2015-02-06 12:57:49 +0100 [trace]: fluent/plugin.rb:72:register_impl: register
@VAdamec
VAdamec / vmware_clone_with_vapp
Created February 21, 2015 04:59
VM vApp playbook
---
- hosts: 127.0.0.1
connection: local
sudo: false
gather_facts: false
serial: 1
vars_files:
- pass.yml
- vars.yml
- description.yml # setup by Jenkins
@VAdamec
VAdamec / setup_vapp.py
Created September 22, 2015 03:44
Set new VM VAPP parameters
#!/usr/bin/python
import optparse
from pprint import pprint
import sys
# from pysphere.vi_vapp import VIVApp
from pysphere import VIServer, VITask, MORTypes, VIProperty
from pysphere.resources import VimService_services as VI
# CFG
@VAdamec
VAdamec / clone.yml
Created September 22, 2015 03:45
Init VM clonning + basic setup
---
- hosts: 127.0.0.1
sudo: false
gather_facts: false
serial: 1
vars_files:
- pass.yml
- vars.yml
- description.yml
@VAdamec
VAdamec / vlan_set.py
Created September 22, 2015 03:48
Set VLAN of VM server
#!/usr/bin/python
import optparse
from pprint import pprint
import sys
from pysphere import *
from pysphere.resources import VimService_services as VI
# CFG
vcenter = "vspeher.example.com"
@VAdamec
VAdamec / vappiti
Created September 22, 2015 03:52
Init script for new VM network setup via VAPP
#!/bin/bash
#
# rc file for VM config via VAPP setup
#
# chkconfig: 2345 9 99
# description: Customize vmware virtual host after creation from template
#
### BEGIN INIT INFO
# Provides: $vapiti
# Default-Start: 3 4 5
@VAdamec
VAdamec / create_folder_moveit.py
Created September 22, 2015 03:56
Doesn't work yet, just concept how to move new VM to project specific folder in vSphere
#!/usr/bin/python
#
# project-type-env-DC type-DC###
# \<location_file DC name>\Team\<location_file IDC/EDC/DMZ>\project\env\
#
import optparse
from pysphere import *
from pysphere.resources import VimService_services as VI