http_log_console

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

README

Monitor HTTP access logs in your terminal.

Build

$ go get github.com/tools/godep
$ godep go test
$ godep go build

Run

$ ./http_log_console  -h
Usage of ./http_log_console:
  -f string
        HTTP log file to monitor
  -i int
        Interval at which statistics should be emitted (default 10)
  -t int
        Alarm threshold (default 100)
  -w int
        Alarm evaluation period (default 120)
$ ./http_log_console -f /var/log/nginx/access.log -i 10 -t 1000 -w 120

To-Do

  • The log processor relies on a fixed regexp pattern for parsing the logs. For greater flexibility, it should be split into 2 components: one for tailing the log file and another one for parsing the payload.
  • The log processor should expose metrics about how many logs have been processed, broken down by success/failure.
  • The pipeline is assembled "manually" in the main() function. We should implement a generic pipeline system that would allow an arbitrary number of workers consuming the same input stream (a typical example would be to run multiple alarm workers) and even chaining workers one after the other.
  • The statistic and alarm workers return respectively slices of strings and strings. Instead they should return structures implementing the String() interface.
  • The implementation of the alarm testing is quite crude and should be revised to be more deterministic (eg not rely on arbitrary timeouts).

License

This work is released under the Apache 2.0 license.

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
pkg
atime
Package atime provides a fast monotonic clock source.
Package atime provides a fast monotonic clock source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL