Skip to content

Commit

Permalink
Ensure lines are in order and expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Oct 4, 2012
1 parent e57842d commit dc00b19
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/examples/mysql-slow-query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
describe "parse mysql slow query log" do
extend LogStash::RSpec

# The logstash config goes here.
# At this time, only filters are supported.
config <<-'CONFIG'
filter {
grep {
Expand Down Expand Up @@ -57,7 +55,10 @@
event = subject.first
insist { event.message.split("\n").size } == 5 # 5 lines

p event.fields
lines.split("\n").each_with_index do |line, i|
insist { event.message[i] } == line
end

insist { event["user"] } == "someuser"
insist { event["host"] } == "db.example.com"
insist { event["ip"] } == "1.2.3.4"
Expand Down

0 comments on commit dc00b19

Please sign in to comment.