【发布时间】:2015-10-26 04:46:39
【问题描述】:
我正在使用 splunk、hapijs(Good, GoodConsole, GoodFile) 进行日志记录。我所有的事件都以 json 格式正确格式化,并完美地显示在 splunk 中。但是我手动记录的日志:
server.log('info', 'Preparing to start server for environment ' + process.env.NODE_ENV);
server.log('info', 'Server running at: ' + server.info.uri);
这些日志在 splunk 中的格式不正确。
{"event":"log","timestamp":1445829225256,"tags":["info"],"data":"Preparing to start server for environment local","pid":17232}
{"event":"log","timestamp":1445829225265,"tags":["info"],"data":"Server running at: http://MyMachine.local:9000","pid":17332}
{"event":"log","timestamp":1445829225268,"tags":["info"],"data":"Communicating with Other server at: http://10.7.219.18:80”,”pid":17332}
Splunk 将它们视为 1 个事件,我无法对此进行查询。
【问题讨论】:
-
您能否针对不了解 Splunk 或它的功能的人详细说明您的问题?他们的日志是什么样的?它们应该是什么样子?
-
@MattHarrison 是服务器日志的云解决方案。我们可以很容易地对这些日志进行分析.. 更多细节splunk.com
-
@AbhishekNalwaya 我不确定我是否理解你的问题,你能改写你的问题吗?
标签: node.js logging splunk hapijs