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

mtail is not working in centos 6 #755

Open
gnanaseka-gajendiran opened this issue Aug 1, 2023 · 1 comment
Open

mtail is not working in centos 6 #755

gnanaseka-gajendiran opened this issue Aug 1, 2023 · 1 comment
Labels
question This issue looks like a usage problem, not a bug or feature request

Comments

@gnanaseka-gajendiran
Copy link

gnanaseka-gajendiran commented Aug 1, 2023

Running mtail like below

/tmp/weblog_exporter/mtail -port=13904 -progs=/tmp/weblog_exporter/apache_combined.mtail -logs=/usr/local/apache/vhosts/*/logs/*access*log.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] -logtostderr &

mtail version

./mtail --version
mtail version 3.0.0-rc52 git revision 6c1f19c1f95ccf1afe2708e41d188bd656db3aa1 go version go1.20.5 go arch amd64 go os linux

/tmp/weblog_exporter/apache_combined.mtail

# Copyright 2015 Ben Kochie <[email protected]>. All Rights Reserved.
# This file is available under the Apache license.

# Parser for the common apache "NCSA extended/combined" log format
# LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"
counter apache_http_requests_total by request_method, http_version, request_status
counter apache_http_bytes_total by request_method, http_version, request_status

/^/ +
/(?P<hostname>[0-9A-Za-z\.:-]+) / + # %h
/(?P<remote_logname>[0-9A-Za-z-]+) / + # %l
/(?P<remote_username>[0-9A-Za-z-]+) / + # %u
/\[(?P<timestamp>\d{2}\/\w{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|-)\d{4})\] / + # %t
/"(?P<request_method>[A-Z]+) (?P<URI>\S+) (?P<http_version>HTTP\/[0-9\.]+)" / + # \"%r\"
/(?P<request_status>\d{3}) / + # %>s
/((?P<response_size>\d+)|-) / + # %b
/"(?P<referer>\S+)" / + # \"%{Referer}i\"
/"(?P<user_agent>[[:print:]]+)"/ + # \"%{User-agent}i\"
/$/ {
  strptime($timestamp, "02/Jan/2006:15:04:05 -0700") # for tests

  apache_http_requests_total[$request_method][$http_version][$request_status]++
  $response_size > 0 {
      apache_http_bytes_total[$request_method][$http_version][$request_status] += $response_size
  }
}

Logs

I0801 20:25:53.401653   20497 store.go:189] Starting metric store expiry loop every 1h0m0s
I0801 20:25:53.404956   20497 checker.go:254] capture group reference `10' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.404996   20497 checker.go:254] capture group reference `referer' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405004   20497 checker.go:254] capture group reference `hostname' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405011   20497 checker.go:254] capture group reference `URI' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405016   20497 checker.go:254] capture group reference `remote_username' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405022   20497 checker.go:254] capture group reference `remote_username' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405028   20497 checker.go:254] capture group reference `5' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405034   20497 checker.go:254] capture group reference `remote_logname' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405046   20497 checker.go:254] capture group reference `remote_logname' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405057   20497 checker.go:254] capture group reference `URI' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405065   20497 checker.go:254] capture group reference `referer' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405071   20497 checker.go:254] capture group reference `hostname' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405077   20497 checker.go:254] capture group reference `user_agent' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405082   20497 checker.go:254] capture group reference `user_agent' at apache_combined.mtail:9:1-3 appears to be unused
I0801 20:25:53.405321   20497 runtime.go:187] Loaded program apache_combined.mtail
I0801 20:25:53.405957   20497 logstream.go:61] Parsed url as /logs/ssl_access_log.20230801
I0801 20:25:53.406212   20497 tail.go:287] Tailing /logs/ssl_access_log.20230801
I0801 20:25:53.406237   20497 logstream.go:61] Parsed url as /logs/access_log.20230801
I0801 20:25:53.406353   20497 tail.go:287] Tailing /logs/access_log.20230801
I0801 20:25:53.406394   20497 logstream.go:61] Parsed url as /logs/ssl_access_log.20230801
I0801 20:25:53.406464   20497 tail.go:287] Tailing /logs/ssl_access_log.20230801
I0801 20:25:53.406649   20497 mtail.go:136] Listening on 0.0.0.0:13904

my log format

xxx.67.92.xxx - - [01/Aug/2023:17:43:06 +0900] "GET /api/v2/auth/systems HTTP/1.1" 200 448 "http://localhost:1080/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/115.0" - 88301 api.xyz.co

I don't see any error or metrics

@jaqx0r
Copy link
Contributor

jaqx0r commented Apr 21, 2024

Please follow the testing https://github.com/google/mtail/blob/main/docs/Testing.md and troubleshooting https://github.com/google/mtail/blob/main/docs/Troubleshooting.md guides and report back with more information please.

@jaqx0r jaqx0r added the question This issue looks like a usage problem, not a bug or feature request label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue looks like a usage problem, not a bug or feature request
Projects
None yet
Development

No branches or pull requests

2 participants