Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot stop program #199

Open
KnifeFly opened this issue Nov 17, 2022 · 3 comments
Open

Cannot stop program #199

KnifeFly opened this issue Nov 17, 2022 · 3 comments

Comments

@KnifeFly
Copy link

KnifeFly commented Nov 17, 2022

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

@tsaikd
Copy link
Owner

tsaikd commented Nov 17, 2022

Is your input file huge for each line?

@KnifeFly
Copy link
Author

KnifeFly commented Nov 18, 2022

@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"

@tsaikd
Copy link
Owner

tsaikd commented Nov 22, 2022

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) ✗ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants