magnusbaeck / logstash-filter-verifier

Apache License 2.0
195 stars 27 forks source link

exit status 1 #3

Closed youngmip closed 8 years ago

youngmip commented 8 years ago

Hi,

Thank you for providing this fabulous tool!

I have tried but it returned 'exit status 1'

This is what I have got (I deleted actual long paths):

./logstash-filter-verifier --loglevel=DEBUG --logstash-path="/somewhere/logstash-2.0.0/bin/logstash"  /test_file_path/logstash-test.json /config_file_path/test.conf
2016/02/10 10:09:32 Reading test case file: /test_file_path/logstash-test.json (/test_file_path/logstash-test.json)
2016/02/10 10:09:32 Starting "/somewhere/logstash-2.0.0/bin/logstash" with args ["/somewhere/logstash-2.0.0/bin/logstash" "--filterworkers" "1" "--debug" "-e" "input { stdin { codec => \"plain\" add_field => { \"type\" => \"logs\" } } } output { file { path => \"/tmp/661929992\" codec => \"json_lines\" } }" "--log" "/tmp/483460551" "--config" "/config_file_path/test.conf"].
2016/02/10 10:09:32 Waiting for child with pid 17670 to terminate.
exit status 1

Can you please help me?

Youngmi.

magnusbaeck commented 8 years ago

That's a really awful error message from the program! I suspect there are good clues in the Logstash log file (/tmp/483460551 in this case), but that output is thrown away. I can publish a fix within a day or two, but if you can compile the program yourself you could add a log statement to runTests() in logstash-filter-verifier.go (untested):

        result, err := p.Wait()
        if err != nil {
            log.Error("Logstash log output: %s", result.Log)  // <--- add this line
            return err
        }

There shouldn't be that many reasons for Logstash to fail. Are you sure the configuration is syntactically correct (e.g. passes logstash --configtest)?

magnusbaeck commented 8 years ago

Are you by any chance running Logstash 2.2? If so please check out #4 for details about what's going on. I've pushed a commit that fixes that problem and I'll fix the bad error message in a 1.0.1 release later this week.

youngmip commented 8 years ago

Thanks a lot ! I have tried with 2.2 as well. I will check the link #4.

magnusbaeck commented 8 years ago

The Logstash 2.2.0 problem is addressed by https://github.com/magnusbaeck/logstash-filter-verifier/commit/d4094a0e5993cb726d7db44905efc92d0363b5d9 and the poor error message is made less poor in commit https://github.com/magnusbaeck/logstash-filter-verifier/commit/0e13934758a072dbd34037c4cc7d8d1d10199f61. Both fixes are available in 1.0.1.