untergeek: i see your name on a lot of rspec-related issues... might you have some insight on why I get a grokparsefailure in rspec (but not in my full LS config or in a test LS harness)?
tsullivan has quit
untergeek
not without any context
rastro runs to pastebin...
tsullivan joined the channel
shaggy_
hi all, i'm seeing a (potential)? issue where the logstash.stdout log file on my logstash server is growing quite large
i read from a redis server as the input into the logstash server
is this normal?
tsullivan has quit
valeech
shaggy_ is stdout a configured output?
shaggy_
valeech: yes
valeech
shaggy_ the log file will continue to grow until you rotate it or disable the output
shaggy_
okay
so it figures out where the logdir is?
# grep stdout *
20-output.conf: stdout { codec => rubydebug }
that's all i have
ahh okay, ogdir is in the startup script
allrighty, looks like i have some logrotate to setup
oh lame. the included logrotate config gets dropped in the wrong mode for logrotate to use it
rastro
untergeek: well, all i have to go on are the tests that shipped with the product (which all use insist), other stuff elastic publishes, and the random wiki.
shaggy_
included in the logstash rpm that is
untergeek
we're getting away from insist by degrees, just saying
rastro
untergeek: would the use of insist cause the GPF?
shaggy_
rastro: i will likely remove the stdout once i'm done
untergeek
no
KungFuVillain has quit
but I wouldn't rule it out
rastro
lol
untergeek
I recommend using %{SPACE} instead of \s+
even if they're syntactically identical behind the scenes
and I worry about (%{URIPROTO}://)
tsullivan joined the channel
rastro
untergeek: the grok works in my production config and in a small LS test harness. it GPFs in rspec.
untergeek
slashes and [] tend to do much better when escaped
it could be that rspec is more strict
how come you're using @message syntax?
torrancew
rastro: ^^^^
that
I think that is probably the source of your immediate problem
tsullivan has quit
untergeek
rastro: You're matching: match => [ "message",
but then you're using @message later
why?
it can't find a message field because you're passing in your sample line as "@message"
but grok is looking for a "message" field (no @)
rastro
untergeek: as to why, it's because every example on the internet uses it. will go test...
torrancew
rastro: they're just outdated (pre-1.2)
untergeek
they're stale, as torrancew pointed out
rastro
changed to sample("message" => message...) and it produces the same error. is there some other syntax there?
in the debug, shows this nesting: @lut={"message"=>[{"message"=>"1448797802.050....
rastro: I would completely bypass that as it's not being set in the grok filter anyway
if you need to test it, test it in a different block
rastro
untergeek: i will be testing my entire config (which includes conditionals), not just a single grok.
untergeek
use a different test block
one test at a time
Karunamon joined the channel
rastro
i want it to read my production config file and test the final output based on a given input.
untergeek
it's tempting to try two birds with one stone, but that's clearly not working here, where working examples of just the grok rules do exist
torrancew
rastro: fwiw, looking at the definition of sample now, it may be a matter of wrapping {} around the input
that aside though, I'd really lean more towards doing integration tests by running your filter config through a real LS instance with more simplified input/output plugins
rastro: 109 of test_utils.rb is assert_equal(expected_lines, actual_lines)
torrancew
then you can build a sample input file and its known equivalent
rastro
torrancew: i was hoping to use the rspec expect stuff and not have to write my own.
torrancew
well, you're definitely going to find writing a single rspec test for a whole config pipeline very frustrating
tsullivan joined the channel
may be easier to wire up a harness of running ls, recording output to a file, and using ruby/python/whatever to parse the json ls generates and compare it to known good json
rastro
torrancew: my config is split into 30 different files. i was expecting to have 30 rspec tests to match them, each reading the production config file.
torrancew
(ordering may change, so you'd want to actually parse it into objects and compare those)
rastro: sure, but that's really not the point I'm trying to make; rspec is for unit testing, and lends itself to such (where units tend to be small and focused)
I'm assuming that your 30 files are basically 30 different filter pipelines constrained by type/tag/whatever, no?
rastro
torrancew: rspec takes a sample input and allows you to examine your output. seems like precisely what i need.
torrancew: yes, that's the layout.
tsullivan has quit
torrancew
let me be clear
you *can* do it
but it's probably going to feel clunky and drive you half mad in the process
rastro
torrancew: considering there are no working examples, and two of the smartest people that i know can't figure it out....
BIGkbs1: no, i didn't follow that.
BIGkbs1
rastro: so your pastebin.. im catching up...
wrath0r
Are there any developers for the logstash-plugins package around?
torrancew
rastro: think BIGkbs1 is pointing out lines that threw traces
BIGkbs1
looks like youre running this "1448797802.050 511 1.2.3.4 TCP_MISS/201 824 PUT http://2.3.4.5:1234/example.html - HIER_DIRECT/69.78.224.182 text/html"
thru the logstash config
rastro
BIGkbs1: that's the sample input, yes.
BIGkbs1
and it throws error
rastro
BIGkbs1: indeed.
BIGkbs1
so thats a good test
rastro
BIGkbs1: i thought so :)
BIGkbs1
what more did you need?
was your idea to verify the data before sending it in?
sndcrb joined the channel
rastro
BIGkbs1: the pattern works for that input, but it throws a GPF and other fields get all jinky (as discussed earlier).