当名称为 hello.imp 的文件低于 10 个字节时,从日志文件创建 Splunk 警报

发布于 2025-01-17 16:37:22 字数 113 浏览 0 评论 0原文

我正在尝试编写一个 Splunk 查询,它从日志文件中搜索名为 hello.imp 的文件,如果文件大小低于 10 字节,则返回一个输出。我有索引和日志位置,但无法找到确切的查询。请帮助我编写查询并从中创建警报。

I'm trying to write a Splunk query where it searches for a file called hello.imp from a log file and returns with a output if the file size is below 10 bytes. I have the index and log location but unable to find the exact query. Please help me out in a writing a query and creating an alert out of it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

预谋 2025-01-24 16:37:22

您可以通过将文件中每个事件的大小相加来获取源文件的大小。像这样:

index=foo source=bar
| eval size=len(_raw)
| stats sum(size) as TotalSize

You can get the size of a source file by adding up the sizes of each event within that file. Like this:

index=foo source=bar
| eval size=len(_raw)
| stats sum(size) as TotalSize
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文