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

Valuecounter: Unsupported field type. Must be an int, string or bool. Ignoring. On field HTTP/%{NUMBER:http_version:float}" #5162

Closed
ledzepp4eva opened this issue Dec 19, 2018 · 0 comments · Fixed by #5168
Assignees
Labels
feature request Requests for new plugin and for new features to existing plugins
Milestone

Comments

@ledzepp4eva
Copy link

Relevant telegraf.conf:

[[aggregators.valuecounter]]
  namepass = ["nginx_access_log"]
  fields = ["response","upstream_status","method","ssl_protocol","upstream_response_time","host_header","client_ip","upstream_cache_status","http_version","ssl_cipher"]




[[inputs.logparser]]
  files = ["/var/log/nginx/access.log"]

  [inputs.logparser.grok]
    patterns = ["%{ACCESS_LOG}"]
    custom_patterns = '''
TLSRU [r.-]
NGINX_ERR_DATE %{YEAR}/%{MONTHNUM}/%{MONTHDAY} %{TIME}
NGUSERNAME [a-zA-Z\.\@\-\+_%]+
NGUSER %{NGUSERNAME}
ACCESS_LOG %{IPORHOST:client_ip} - %{NGUSER:remote_user} \[%{HTTPDATE:timestamp}\] "%{WORD:method} %{URIPATHPARAM:request} HTTP/%{NUMBER:http_version:float}" %{NUMBER:response:int} (?:%{NUMBER:bytes:int}|-) (?:"(?:%{URI:referrer}|-)"|%{QS:referrer}) %{QS:user_agent} "(%{DATA:x-forwarded-for}|-)" %{NOTSPACE:upstream_cache_status} %{NUMBER:request_time} %{POSINT:port} %{NOTSPACE:ssl_protocol} %{NOTSPACE:ssl_cipher} %{IP:server_ip} %{GREEDYDATA:host_header} %{GREEDYDATA:hostname} "(%{IP:upstream_address}:%{POSINT:upstream_port:int}\ \:\ %{IP:upstream_address}:%{POSINT:upstream_port:int}|\[%{IP:upstream_address}\]:%{POSINT:upstream_port:int}\ \:\ %{IP:upstream_address}:%{POSINT:upstream_port:int}|%{IP:upstream_address}:%{POSINT:upstream_port:int}|\[%{IP:upstream_address}\]:%{POSINT:upstream_port:int}|-)" "(%{NUMBER:upstream_status:int}\ \:\ %{NUMBER:upstream_status:int}|%{NUMBER:upstream_status:int}|-)" "(%{NUMBER:upstream_response_time:float}\ \:\ %{NUMBER:upstream_response_time:float}|%{NUMBER:upstream_response_time:float}|-)" "(%{NUMBER:upstream_response_length:int}\ \:\ %{NUMBER:upstream_response_length:int}|%{NUMBER:upstream_response_length:int}|-)" %{TLSRU:tls_reuse} %{GREEDYDATA:ssl_server_name} "%{DATA:request_id}"
'''
    measurement = "nginx_access_log"

System info:

Telegraf 1.8.1 (git: HEAD ae9efb2f)
CentOS Linux release 7.5.1804 (Core) 

Steps to reproduce:

  1. Implement the above configuration with the following log_format in nginx
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for" ' '$upstream_cache_status '
                  '$request_time $server_port $ssl_protocol $ssl_cipher $server_addr $host $hostname '
                  '"$upstream_addr" ' '"$upstream_status" ' '"$upstream_response_time" ' '"$upstream_response_length" '
                  '$ssl_session_reused ' '$ssl_server_name' ' "$request_id"';
  1. Try and aggregate the http_version that is marked as a float because of the possible values of 1,1.1 and 2.0

Expected behavior:

I would like to be able to aggregate the http_version field, which is float type.

Actual behavior:

Dec 19 10:20:29 6 telegraf: 2018-12-19T10:20:29Z I! Valuecounter: Unsupported field type. Must be an int, string or bool. Ignoring.

Additional info:

Dec 19 10:20:29 6 telegraf: 2018-12-19T10:20:29Z I! Valuecounter: Unsupported field type. Must be an int, string or bool. Ignoring.
@danielnelson danielnelson added the feature request Requests for new plugin and for new features to existing plugins label Dec 19, 2018
@danielnelson danielnelson added this to the 1.10.0 milestone Dec 19, 2018
@danielnelson danielnelson self-assigned this Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants