Skip to content

Instantly share code, notes, and snippets.

View acharlieh's full-sized avatar
🐻
Rawr

Charlie Huggard acharlieh

🐻
Rawr
View GitHub Profile
@acharlieh
acharlieh / gist:2444a54949916dd81231
Last active August 29, 2015 14:08
Splunk Search Streaming Window of more than X hits per minute by an ip for Y consecutive minutes.
index=yourindexes sourcetype=access_combined uri_path=/login
| eval _time=relative_time(_time,"@m")
| stats count by clientip,_time
| where count > X
| appendpipe
[ dedup clientip
| map
[ gentimes increment=1m
[ noop
| stats count
@acharlieh
acharlieh / gist:777d6767378e82427d00
Last active August 29, 2015 14:06
Playing with Splunk DOW
| noop | stats count | fields 
| eval num=mvrange(0,40,1) | mvexpand num 
| eval _time=relative_time(now(),"-".num."d@d")
| eval day=strftime(_time,"%A - %F") 
| timechart span=w count,list(day)

Have your search time range be at least: earliest=-40d@d latest=now otherwise you confuse the embedded bucket command by presenting data that's not in the time range.

This is a Gist of useful Splunk Queries.
@acharlieh
acharlieh / Vagrantfile
Created December 13, 2013 20:28
Vagrantfile for demonstrating hostname / hostname -f oddities
# -*- mode: ruby -*-
# vi: set ft=ruby :
@boxes = {
centos510: {box:'opscode_centos-5.10_provisionerless',box_url:'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.10_chef-provisionerless.box'},
centos65: {box:'opscode_centos-6.5_provisionerless',box_url:'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box'},
}
Vagrant.configure('2') do |config|
config.berkshelf.enabled = false
@acharlieh
acharlieh / Vagrantfile
Last active December 31, 2015 06:29
Vagrant 1.4.0 failure bringing up Enterprise Linux 6.5. See https://github.com/mitchellh/vagrant/issues/2650
# -*- mode: ruby -*-
# vi: set ft=ruby :
@boxes = {
centos510: {box:'opscode_centos-5.10_provisionerless',box_url:'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.10_chef-provisionerless.box'},
centos65: {box:'opscode_centos-6.5_provisionerless',box_url:'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box'},
}
Vagrant.configure('2') do |config|
config.berkshelf.enabled = false