Add doc comments

This commit is contained in:
Jordan Sissel 2012-08-30 03:37:37 -04:00
parent 81c15323ec
commit 4e26701709

View file

@ -2,6 +2,9 @@ require "test_utils"
describe "apache common log format" do
extend LogStash::RSpec
# The logstash config goes here.
# At this time, only filters are supported.
config <<-CONFIG
filter {
grok {
@ -11,8 +14,16 @@ describe "apache common log format" do
}
CONFIG
# Here we provide a sample log event for the testing suite.
sample '198.151.8.4 - - [29/Aug/2012:20:17:38 -0400] "GET /favicon.ico HTTP/1.1" 200 3638 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1"' do
# These 'insist' and 'reject' calls use my 'insist' rubygem.
# See http://rubydoc.info/gems/insist for more info.
# Require that grok does not fail to parse this event.
reject { subject["@tags"] }.include?("_grokparsefailure")
# Ensure that grok captures certain expected fields.
insist { subject }.include?("agent")
insist { subject }.include?("bytes")
insist { subject }.include?("clientip")
@ -22,6 +33,7 @@ describe "apache common log format" do
insist { subject }.include?("response")
insist { subject }.include?("request")
# Ensure that those fields match expected values from the event.
insist { subject["clientip"] } == "198.151.8.4"
insist { subject["timestamp"] } == "29/Aug/2012:20:17:38 -0400"
insist { subject["verb"] } == "GET"