puppetlabs / support-script-analyzer

3 stars 3 forks source link

Add access log output #10

Closed jarretlavallee closed 3 years ago

jarretlavallee commented 3 years ago

Use Case

Add a section for each service for the errors in the access logs. These should be items like 404's, 503's, 500's, etc.

Additional Context

@coreymbe Should this be counts per minute, or the raw display?

Another consideration is that some 404s are expected. Such as when an agent is doing a cert request for the first time, we would expect there to be a 404 on the cert API call. So that could make this a little more complicated.

m0dular commented 3 years ago

@jarretlavallee Since these are standard Apache log format, we can probably use existing tools for this. For example, goaccess works.

goaccess --log-format COMBINED logs/puppetserver/puppetserver-access.log

Is this or another tool suitable?

jarretlavallee commented 3 years ago

Introducing a tool to reduce the maintenance burden and increase the capabilities is a good idea. goaccess is available in brew on MacOS so it seems like an easy fit.

jarretlavallee commented 3 years ago

@coreymbe Thoughts on ^^

coreymbe commented 3 years ago

Sorry for the delayed response on this one @jarretlavallee.

Should this be counts per minute, or the raw display? I wouldn't mind seeing both of those to be honest. I can think of scenarios where I would be more interested in one over the other.

m0dular commented 3 years ago

Of the requests here, I think the only thing goaccess doesn't do is break down 500 errors by endpoint. That shouldn't be too hard to work into the script.

m0dular commented 3 years ago

@jarretlavallee @coreymbe I've added this to a feature in my fork. Could you test it out and look for the access_log_errors entry in the output? If it works ok I'll merge it into master. Here's how to test out the feature:

git remote add m0d git@github.com:m0dular/support-tooling.git
git fetch --all
git checkout aph/access-parse
m0dular commented 3 years ago

@cwebster61083 Gives it the :+1:

m0dular commented 3 years ago

Added in #14