Created
June 8, 2020 13:35
-
-
Save rawkode/11830489b4ebeadc2d0bfaf94b914329 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from(bucket: "devrel-platform-metrics") | |
|> range(start: v.timeRangeStart, stop: v.timeRangeStop) | |
|> filter(fn: (r) => r["_measurement"] == "docker_hub") | |
|> filter(fn: (r) => r["_field"] == "pull_count") | |
|> group(columns: ["url"]) | |
|> count() | |
|> group() | |
|> sort(columns: ["_value"], desc: true) |
For the first query I just need to filter to any one of the fields to deduplicate them, right. I think that's basically it. The Histogram automaticallyt breaks them into loglevels.
from(bucket: "bucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "apache_error")
|> filter(fn: (r) => r["_field"] == "client")
OK. I'm watching some videos so I actually understand this stuff. Hopefully I'll be able to work out the other query.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks Dave. I didn't get this working yet. I'm not really sure if it's the structure of the data that I don't understand or how to query the data.
I've got Telegraf collecting PHP/Apache error logs. A line looks like this:
Am I right in thinking that gets imported like below?
loglevel
is a tag, so it applies to all of them, I think? Should anything else be a tag? Would importing the data differently make it easier to query?The information I'd like to get from this:
How many errors are occurring?
A bar chart (or something) showing the total number or errors logged each minute/hour/day.
What are the most common errors?