@ 有弹性/ makelogs
简单的生成器用来将假的HTTP流量日志推入弹性搜索. 它使用节点.js客户端.
这个makelogs的版本被设计为与从弹性搜索大师所创建的最新架构相配合,与之前的版本不相容.
事件被推向 logstash-YYYY.MM.DD 格式化索引(可使用 --indexPrefix),使用散装API,并易被克巴纳所消耗.
文件是这样的:
{
"_index": "logstash-2014.06.17",
"_type": "_doc",
"_id": "706786",
"_score": 11.412156,
"_source": {
"index": "logstash-2014.06.17",
"@timestamp": "2014-06-17T17:00:27.053Z",
"ip": "225.27.202.82",
"extension": "html",
"response": "200",
"geo": {
"coordinates": [
44.23107,
-94.99893444
],
"src": "IM",
"dest": "PK",
"srcdest": "IM:PK"
},
"@tags": [
"error",
"info"
],
"utc_time": "2014-06-17T17:00:27.053Z",
"referer": "http://nytimes.com/error/gemini-11",
"agent": "Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1",
"clientip": "225.27.202.82",
"bytes": 5108.1583889899775,
"request": "/ivan-bella.html",
"@message": "225.27.202.82 - - [2014-06-17T17:00:27.053Z] \"GET /ivan-bella.html HTTP/1.1\" 200 5108.1583889899775 \"-\" \"Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1\"",
"spaces": "this is a thing with lots of spaces wwwwoooooo",
"xss": "<script>console.log(\"xss\")</script>",
"headings": [
"<h3>robert-satcher</h5>",
"http://twitter.com/success/scott-altman"
],
"links": [
"[email protected]",
"http://www.slate.com/info/boris-yegorov",
"www.twitter.com"
],
"machine": {
"os": "win 7",
"ram": 17179869184
}
}
}
要安装
npm install -g @elastic/makelogs
然后运行 makelogs --help 用于用户信息 :
$ ./bin/makelogs --help
A utility to generate sample log data.
Usage: node ./bin/makelogs@beta [options]
Options:
...
诚然,这个工具不是超能的。 告诉它你想要多少事件, 需要多少天来生成数据, 它会游走.
不要在生产弹性搜索装置上使用它.
事件流可以是tad unfuse,并且可能对负载下弹性搜索集群造成一些破坏. 它是为本地调试而设计的.