-
Notifications
You must be signed in to change notification settings - Fork 395
Open
Labels
bugThis is considered a bug and shall get fixedThis is considered a bug and shall get fixedmtail-Language/VMIssues related to the mtail language, compiler, or VMIssues related to the mtail language, compiler, or VM
Description
Summary
Certain regex patterns when used to capture an IP address are causing mtail to try and parse IP addresses as a float:
Runtime error: strconv.ParseFloat: parsing "10.0.0.1": invalid syntax
I have included an mtail program below that can recreate the problem along with a similar program that does not cause the problem. Curiously this seems to only occur when creating a histogram metric.
Steps to reproduce:
mtail --one_shot --progs broken.mtail --logs example.log -logtostderr- Verify
Runtime erroroccurs mtail --one_shot --progs working.mtail --logs example.log -logtostderr- Verify program runs as expected
mtail --version
mtail version 3.0.0-rc47 git revision 5e0099f843e4e4f2b7189c21019de18eb49181bf go version go1.16.5 go arch amd64 go os darwin
AST Type Dump
I have attempted to get a type dump by running:
mtail --one_shot --progs broken.mtail --logs example.log --dump_ast_types --log_dir outputmtail --one_shot --compile_only --progs broken.mtail --logs example.log --dump_ast_types --log_dir output
Neither has resulted in a log beyond:
Log file created at: 2021/09/28 15:20:02
Running on machine: MY_MACHINE_NAME
Binary: Built with gc go1.16.5 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
Let me know if I am running this command incorrectly and I can submit the appropriate log.
Thanks!
example.log
10.0.0.1 total_time=5
10.0.0.2 total_time=742
broken.mtail
histogram example_name buckets 1, 2 by instance
/^(?P<ip>[\d\.]+) total_time=(?P<total>\d+)/ {
example_name[$ip] = $total / 1000.0
}
working.mtail
histogram example_name buckets 1, 2 by instance
/^(?P<ip>\d+(?:\.\d+){3}) total_time=(?P<total>\d+)/ {
example_name[$ip] = $total / 1000.0
}
matejzero
Metadata
Metadata
Assignees
Labels
bugThis is considered a bug and shall get fixedThis is considered a bug and shall get fixedmtail-Language/VMIssues related to the mtail language, compiler, or VMIssues related to the mtail language, compiler, or VM