gogstash icon indicating copy to clipboard operation
gogstash copied to clipboard

Cannot stop program

Open KnifeFly opened this issue 3 years ago • 3 comments

i clone and build, and start program:

./gogstash worker --config ./gogstash.yml

gogstash.yml config file content:

worker: 2
chsize: 1000

input:
  - type: file
    path: /tmp/logstash-tutorial.log
    start_position: beginning
    sincedb_write_interval: 5

output:
  - type: stdout
    codec: json

while i want to stop the program, so i enter command + c to interrupt, but seems the program cannot stop, just print interrupt information, i sam not sure that happen.

image
util.go:116 [info] interrupt

machine: macos 12.5.1 go version: go version go1.18.5 darwin/amd64

KnifeFly avatar Nov 17 '22 13:11 KnifeFly

Is your input file huge for each line?

tsaikd avatar Nov 17 '22 13:11 tsaikd

@tsaikd hihi, i am I'm afraid not, each line format is Apache log format, and only have 4 lines for /tmp/logstash-tutorial.log

83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] "GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1" 200 203023 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] "GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1" 200 203023 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] "GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1" 200 203023 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] "GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1" 200 203023 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"

KnifeFly avatar Nov 18 '22 03:11 KnifeFly

Unfortunately, I cannot reproduce your state with your input file.

➜  gogstash git:(master) ✗ uname -mprsv
Darwin 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64 arm
➜  gogstash git:(master) ✗ go version
go version go1.19.3 darwin/arm64
➜  gogstash git:(master) ✗ git show-ref HEAD
0813dbd086f870631c5dd25d628002118b52ffa7 refs/remotes/origin/HEAD
➜  gogstash git:(master) ✗ ./gogstash worker --config ./gogstash.yml
2022/11/22 22:49:28 gogstash.go:61 [info] gogstash started...
{"path":"logstash-tutorial.log","@timestamp":"2022-11-22T14:49:28.887501Z","message":"83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] \"GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1\" 200 203023 \"http://semicomplete.com/presentations/logstash-monitorama-2013/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36\"","offset":0,"host":"MBP.local"}
{"host":"MBP.local","path":"logstash-tutorial.log","offset":325,"@timestamp":"2022-11-22T14:49:28.887735Z","message":"83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] \"GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1\" 200 203023 \"http://semicomplete.com/presentations/logstash-monitorama-2013/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36\""}
{"path":"logstash-tutorial.log","offset":650,"@timestamp":"2022-11-22T14:49:28.887741Z","message":"83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] \"GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1\" 200 203023 \"http://semicomplete.com/presentations/logstash-monitorama-2013/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36\"","host":"MBP.local"}
{"@timestamp":"2022-11-22T14:49:28.887742Z","message":"83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] \"GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1\" 200 203023 \"http://semicomplete.com/presentations/logstash-monitorama-2013/\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36\"","offset":975,"host":"MBP.local","path":"logstash-tutorial.log"}
^C2022/11/22 22:49:30 util.go:116 [info] interrupt
2022/11/22 22:49:30 inputfile.go:203 [warning] File recreated, seeking to beginning: "logstash-tutorial.log"
➜  gogstash git:(master) ✗ 

tsaikd avatar Nov 22 '22 14:11 tsaikd