Hey All,
We have implemented a histogram using telegraf aggregator and we got the buckets. Here is what we have so far for configuration and metrics output.
But we are wondering if it is possible to get our buckets to display based on different URI Strings? So different buckets for different unique URL string.
If this is not possible, how can we filter out inputs into the aggregator based on a certain fields value? Ex. Only aggregate values with CSURI=“google.com”.
Configuration:
[[inputs.logparser]]
files = [ "H:\\abc\\logs\\metrics_*.log" ]
from_beginning = false
name_override = "responseTime_metric"
## Parse logstash-style "grok" patterns:
[inputs.logparser.grok]
## This is a list of patterns to check the given log file(s) for.
## Note that adding patterns here increases processing time. The most
## efficient configuration is to have one pattern per logparser.
## Other common built-in patterns are:
## %{COMMON_LOG_FORMAT} (plain apache & nginx access logs)
## %{COMBINED_LOG_FORMAT} (access logs + referrer & agent)
patterns = ['%{URIPATH:uripathStr} %{NOTSPACE:CSURIQuery:drop} %{NUMBER:SPort:drop} %{NOTSPACE:CSUsername:drop} %{IPORHOST:CIP:drop} %{NOTSPACE:CSVersion:drop} %{NOTSPACE:CSUserAgent:drop} %{NOTSPACE:CSCookie:drop} %{NOTSPACE:CSReferer:drop} %{NUMBER:TotalTime:int} ']
Metrics Output:
responseTime_metric_TotalTime{uripathStr="/serverhelp.htm",host="abcdef",servergroup="TEST"} 52
responseTime_metric_TotalTime{host="WSQPWS078",le="+Inf",servergroup="TEST"} 7767
responseTime_metric_TotalTime{host="WSQPWS078",le="100",servergroup="TEST"} 7617
responseTime_metric_TotalTime{host="WSQPWS078",le="200",servergroup="TEST"} 7687
responseTime_metric_TotalTime{host="WSQPWS078",le="500",servergroup="TEST"} 7717
responseTime_metric_TotalTime{host="WSQPWS078",le="1000",servergroup="TEST"} 7757