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

access.log detection / parsing #7

Closed
fduran opened this issue Mar 21, 2014 · 0 comments
Closed

access.log detection / parsing #7

fduran opened this issue Mar 21, 2014 · 0 comments

Comments

@fduran
Copy link

fduran commented Mar 21, 2014

Hello,

After
$ pip install docopt tabulate

I have:

$ python -V
Python 2.7.4

$ grep access_log /etc/nginx/nginx.conf
access_log /var/log/nginx/access.log;

but log file is not detected:

$ python ngxtop.py info
configuration file:
/etc/nginx/nginx.conf
access log file:
logs/access.log
access log format:
combined
available variables:

What's more, explicitly setting the log file breaks:

$ python ngxtop.py --access-log /var/log/nginx/access.log
Traceback (most recent call last):
File "ngxtop.py", line 437, in
main(args)
File "ngxtop.py", line 420, in main
total = process_log(source, pattern, processor, arguments)
File "ngxtop.py", line 325, in process_log
total = processor.process(records)
File "ngxtop.py", line 272, in process
for r in records:
File "ngxtop.py", line 206, in add_field
for item in dict_sequence:
File "ngxtop.py", line 196, in map_field
for item in dict_sequence:
File "ngxtop.py", line 196, in map_field
for item in dict_sequence:
File "ngxtop.py", line 206, in add_field
for item in dict_sequence:
File "ngxtop.py", line 206, in add_field
for item in dict_sequence:
File "ngxtop.py", line 196, in map_field
for item in dict_sequence:
File "ngxtop.py", line 245, in
records = (m.groupdict() for m in matches if m is not None)
File "ngxtop.py", line 244, in
matches = (pattern.match(l) for l in lines)
File "ngxtop.py", line 181, in follow
with open(the_file) as f:
IOError: [Errno 2] No such file or directory: 'logs/access.log'

thanks!

@fduran fduran closed this as completed Mar 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant