通过http跟踪日志文件 [英] following a log file over http

查看:129
本文介绍了通过http跟踪日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于安全原因(我是开发人员),我没有命令行访问我们的生成服务器,其中写入了日志文件。我可以,但是通过HTTP访问这些日志文件。是否有一个以tail -f的方式使用只能使用HTTP跟随纯文本文件的实用程序?

For security reasons (I'm a developer) I do not have command line access to our Production servers where log files are written. I can, however access those log files over HTTP. Is there a utility in the manner of "tail -f" that can "follow" a plain text file using only HTTP?

推荐答案

如果HTTP服务器接受返回资源部分的请求,则可以执行此操作。例如,如果HTTP请求包含标头:

You can do this if the HTTP server accepts requests to return parts of a resource. For example, if an HTTP request contains the header:


范围:bytes = -500

Range: bytes=-500

响应将包含资源的最后500个字节。您可以获取它然后将其解析为行等。我不知道任何现成的客户端会为您执行此操作 - 我会写一个脚本来完成这项工作。

the response will contain the last 500 bytes of the resource. You can fetch that and then parse it into lines, etc. I don't know of any ready-made clients which will do this for you - I'd write a script to do the job.

您可以使用 Hurl 来试验标题(来自公开资源)。

You can use Hurl to experiment with headers (from publicly available resources).

这篇关于通过http跟踪日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆