로그생성 프로그램 - makelogs

Elastic/Logstash 2015. 3. 11. 16:35

logstash에서 제공하는 generator가 쓸만하지 않아서 아래 도구 사용합니다.


[링크]

https://www.npmjs.com/package/makelogs


to install

npm install -g makelogs
makelogs --count=10m --days=-2,+10


[Command Help]

jeong-ui-MBP:makelogs hwjeong$ makelogs --help

A utility to generate sample log data.


Usage: makelogs [options]


Options:

  --count, -c     Total event that will be created, accepts expressions like "1m" for 1 million (b,m,t,h)       [default: 14000]

  --days, -d      The number of days ± today or two numbers, seperated by a comma, like "-1,+10" or "-10,+100"  [default: 1]

  --host, -h      The host name and port                                                                        [default: "localhost:9200"]

  --auth          user:password when you want to connect to a secured elasticsearch cluster over basic auth     [default: null]

  --shards, -s    The number of primary shards                                                                  [default: 1]

  --replicas, -r  The number of replica shards                                                                  [default: 0]

  --dry           Test/Parse your arguments, but don't actually do anything                                     [default: false]

  --help          This help message

  --reset         Clear all logstash-* indices before genrating logs

  --verbose       Log more info to the console

  --trace         Log every request to elastisearch, including request bodies. BE CAREFULL


[예제]

makelogs -c 100 -d 0 -h localhost:9200 -s 1 -r 0 --reset

makelogs -c 100 --days=-1,+1 -h localhost:9200 -s 1 -r 0 --reset


설명) -d 0 는 오늘 날짜 기준으로 데이터 생성

logstash-20150311


설명) --days=-1,+1 은 오늘 날짜 기준으로 앞뒤로 하나씩 인덱스를 더 생성

logstash-20150310

logstash-20150311

logstash-20150312

: