logstash-lib 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (419) hide show
  1. data/.gitignore +24 -0
  2. data/.tailor +8 -0
  3. data/.travis.yml +12 -0
  4. data/CHANGELOG +1185 -0
  5. data/CONTRIBUTING.md +61 -0
  6. data/CONTRIBUTORS +79 -0
  7. data/LICENSE +14 -0
  8. data/Makefile +460 -0
  9. data/README.md +120 -0
  10. data/STYLE.md +96 -0
  11. data/bin/logstash +37 -0
  12. data/bin/logstash-test +4 -0
  13. data/bin/logstash-web +4 -0
  14. data/bin/logstash.lib.sh +78 -0
  15. data/bot/check_pull_changelog.rb +89 -0
  16. data/docs/configuration.md +260 -0
  17. data/docs/docgen.rb +242 -0
  18. data/docs/extending/example-add-a-new-filter.md +121 -0
  19. data/docs/extending/index.md +91 -0
  20. data/docs/flags.md +43 -0
  21. data/docs/generate_index.rb +28 -0
  22. data/docs/index.html.erb +56 -0
  23. data/docs/learn.md +46 -0
  24. data/docs/life-of-an-event.md +109 -0
  25. data/docs/logging-tool-comparisons.md +60 -0
  26. data/docs/plugin-doc.html.erb +91 -0
  27. data/docs/plugin-milestones.md +41 -0
  28. data/docs/plugin-synopsis.html.erb +24 -0
  29. data/docs/release-engineering.md +46 -0
  30. data/docs/release-test-results.md +14 -0
  31. data/docs/repositories.md +35 -0
  32. data/docs/tutorials/10-minute-walkthrough/apache-elasticsearch.conf +35 -0
  33. data/docs/tutorials/10-minute-walkthrough/apache-parse.conf +33 -0
  34. data/docs/tutorials/10-minute-walkthrough/apache_log.1 +1 -0
  35. data/docs/tutorials/10-minute-walkthrough/apache_log.2.bz2 +0 -0
  36. data/docs/tutorials/10-minute-walkthrough/hello-search.conf +25 -0
  37. data/docs/tutorials/10-minute-walkthrough/hello.conf +16 -0
  38. data/docs/tutorials/10-minute-walkthrough/index.md +124 -0
  39. data/docs/tutorials/10-minute-walkthrough/step-5-output.txt +17 -0
  40. data/docs/tutorials/getting-started-centralized-overview-diagram.png +0 -0
  41. data/docs/tutorials/getting-started-centralized-overview-diagram.xml +1 -0
  42. data/docs/tutorials/getting-started-centralized.md +217 -0
  43. data/docs/tutorials/getting-started-simple.md +200 -0
  44. data/docs/tutorials/just-enough-rabbitmq-for-logstash.md +201 -0
  45. data/docs/tutorials/media/frontend-response-codes.png +0 -0
  46. data/docs/tutorials/metrics-from-logs.md +84 -0
  47. data/docs/tutorials/zeromq.md +118 -0
  48. data/extract_services.rb +29 -0
  49. data/gembag.rb +64 -0
  50. data/lib/logstash-event.rb +2 -0
  51. data/lib/logstash.rb +4 -0
  52. data/lib/logstash/JRUBY-6970-openssl.rb +22 -0
  53. data/lib/logstash/JRUBY-6970.rb +102 -0
  54. data/lib/logstash/agent.rb +305 -0
  55. data/lib/logstash/certs/cacert.pem +3895 -0
  56. data/lib/logstash/codecs/base.rb +49 -0
  57. data/lib/logstash/codecs/compress_spooler.rb +50 -0
  58. data/lib/logstash/codecs/dots.rb +18 -0
  59. data/lib/logstash/codecs/edn.rb +28 -0
  60. data/lib/logstash/codecs/edn_lines.rb +36 -0
  61. data/lib/logstash/codecs/fluent.rb +55 -0
  62. data/lib/logstash/codecs/graphite.rb +114 -0
  63. data/lib/logstash/codecs/json.rb +41 -0
  64. data/lib/logstash/codecs/json_lines.rb +52 -0
  65. data/lib/logstash/codecs/json_spooler.rb +22 -0
  66. data/lib/logstash/codecs/line.rb +58 -0
  67. data/lib/logstash/codecs/msgpack.rb +43 -0
  68. data/lib/logstash/codecs/multiline.rb +189 -0
  69. data/lib/logstash/codecs/netflow.rb +342 -0
  70. data/lib/logstash/codecs/netflow/util.rb +212 -0
  71. data/lib/logstash/codecs/noop.rb +19 -0
  72. data/lib/logstash/codecs/oldlogstashjson.rb +56 -0
  73. data/lib/logstash/codecs/plain.rb +48 -0
  74. data/lib/logstash/codecs/rubydebug.rb +22 -0
  75. data/lib/logstash/codecs/spool.rb +38 -0
  76. data/lib/logstash/config/Makefile +4 -0
  77. data/lib/logstash/config/config_ast.rb +380 -0
  78. data/lib/logstash/config/file.rb +39 -0
  79. data/lib/logstash/config/grammar.rb +3504 -0
  80. data/lib/logstash/config/grammar.treetop +241 -0
  81. data/lib/logstash/config/mixin.rb +464 -0
  82. data/lib/logstash/config/registry.rb +13 -0
  83. data/lib/logstash/config/test.conf +18 -0
  84. data/lib/logstash/errors.rb +10 -0
  85. data/lib/logstash/event.rb +262 -0
  86. data/lib/logstash/filters/advisor.rb +178 -0
  87. data/lib/logstash/filters/alter.rb +173 -0
  88. data/lib/logstash/filters/anonymize.rb +93 -0
  89. data/lib/logstash/filters/base.rb +190 -0
  90. data/lib/logstash/filters/checksum.rb +50 -0
  91. data/lib/logstash/filters/cidr.rb +76 -0
  92. data/lib/logstash/filters/cipher.rb +145 -0
  93. data/lib/logstash/filters/clone.rb +35 -0
  94. data/lib/logstash/filters/collate.rb +114 -0
  95. data/lib/logstash/filters/csv.rb +94 -0
  96. data/lib/logstash/filters/date.rb +244 -0
  97. data/lib/logstash/filters/dns.rb +201 -0
  98. data/lib/logstash/filters/drop.rb +32 -0
  99. data/lib/logstash/filters/elapsed.rb +256 -0
  100. data/lib/logstash/filters/elasticsearch.rb +73 -0
  101. data/lib/logstash/filters/environment.rb +27 -0
  102. data/lib/logstash/filters/extractnumbers.rb +84 -0
  103. data/lib/logstash/filters/gelfify.rb +52 -0
  104. data/lib/logstash/filters/geoip.rb +145 -0
  105. data/lib/logstash/filters/grep.rb +153 -0
  106. data/lib/logstash/filters/grok.rb +425 -0
  107. data/lib/logstash/filters/grokdiscovery.rb +75 -0
  108. data/lib/logstash/filters/i18n.rb +51 -0
  109. data/lib/logstash/filters/json.rb +90 -0
  110. data/lib/logstash/filters/json_encode.rb +52 -0
  111. data/lib/logstash/filters/kv.rb +232 -0
  112. data/lib/logstash/filters/metaevent.rb +68 -0
  113. data/lib/logstash/filters/metrics.rb +237 -0
  114. data/lib/logstash/filters/multiline.rb +241 -0
  115. data/lib/logstash/filters/mutate.rb +399 -0
  116. data/lib/logstash/filters/noop.rb +21 -0
  117. data/lib/logstash/filters/prune.rb +149 -0
  118. data/lib/logstash/filters/punct.rb +32 -0
  119. data/lib/logstash/filters/railsparallelrequest.rb +86 -0
  120. data/lib/logstash/filters/range.rb +142 -0
  121. data/lib/logstash/filters/ruby.rb +42 -0
  122. data/lib/logstash/filters/sleep.rb +111 -0
  123. data/lib/logstash/filters/split.rb +64 -0
  124. data/lib/logstash/filters/sumnumbers.rb +73 -0
  125. data/lib/logstash/filters/syslog_pri.rb +107 -0
  126. data/lib/logstash/filters/translate.rb +121 -0
  127. data/lib/logstash/filters/unique.rb +29 -0
  128. data/lib/logstash/filters/urldecode.rb +57 -0
  129. data/lib/logstash/filters/useragent.rb +112 -0
  130. data/lib/logstash/filters/uuid.rb +58 -0
  131. data/lib/logstash/filters/xml.rb +139 -0
  132. data/lib/logstash/filters/zeromq.rb +123 -0
  133. data/lib/logstash/filterworker.rb +122 -0
  134. data/lib/logstash/inputs/base.rb +125 -0
  135. data/lib/logstash/inputs/collectd.rb +306 -0
  136. data/lib/logstash/inputs/drupal_dblog.rb +323 -0
  137. data/lib/logstash/inputs/drupal_dblog/jdbcconnection.rb +66 -0
  138. data/lib/logstash/inputs/elasticsearch.rb +140 -0
  139. data/lib/logstash/inputs/eventlog.rb +129 -0
  140. data/lib/logstash/inputs/eventlog/racob_fix.rb +44 -0
  141. data/lib/logstash/inputs/exec.rb +69 -0
  142. data/lib/logstash/inputs/file.rb +146 -0
  143. data/lib/logstash/inputs/ganglia.rb +127 -0
  144. data/lib/logstash/inputs/ganglia/gmondpacket.rb +146 -0
  145. data/lib/logstash/inputs/ganglia/xdr.rb +327 -0
  146. data/lib/logstash/inputs/gelf.rb +138 -0
  147. data/lib/logstash/inputs/gemfire.rb +222 -0
  148. data/lib/logstash/inputs/generator.rb +97 -0
  149. data/lib/logstash/inputs/graphite.rb +41 -0
  150. data/lib/logstash/inputs/heroku.rb +51 -0
  151. data/lib/logstash/inputs/imap.rb +136 -0
  152. data/lib/logstash/inputs/irc.rb +84 -0
  153. data/lib/logstash/inputs/log4j.rb +136 -0
  154. data/lib/logstash/inputs/lumberjack.rb +53 -0
  155. data/lib/logstash/inputs/pipe.rb +57 -0
  156. data/lib/logstash/inputs/rabbitmq.rb +126 -0
  157. data/lib/logstash/inputs/rabbitmq/bunny.rb +118 -0
  158. data/lib/logstash/inputs/rabbitmq/hot_bunnies.rb +1 -0
  159. data/lib/logstash/inputs/rabbitmq/march_hare.rb +129 -0
  160. data/lib/logstash/inputs/redis.rb +263 -0
  161. data/lib/logstash/inputs/relp.rb +106 -0
  162. data/lib/logstash/inputs/s3.rb +279 -0
  163. data/lib/logstash/inputs/snmptrap.rb +87 -0
  164. data/lib/logstash/inputs/sqlite.rb +185 -0
  165. data/lib/logstash/inputs/sqs.rb +172 -0
  166. data/lib/logstash/inputs/stdin.rb +46 -0
  167. data/lib/logstash/inputs/stomp.rb +84 -0
  168. data/lib/logstash/inputs/syslog.rb +237 -0
  169. data/lib/logstash/inputs/tcp.rb +231 -0
  170. data/lib/logstash/inputs/threadable.rb +18 -0
  171. data/lib/logstash/inputs/twitter.rb +82 -0
  172. data/lib/logstash/inputs/udp.rb +81 -0
  173. data/lib/logstash/inputs/unix.rb +163 -0
  174. data/lib/logstash/inputs/varnishlog.rb +48 -0
  175. data/lib/logstash/inputs/websocket.rb +50 -0
  176. data/lib/logstash/inputs/wmi.rb +72 -0
  177. data/lib/logstash/inputs/xmpp.rb +81 -0
  178. data/lib/logstash/inputs/zenoss.rb +143 -0
  179. data/lib/logstash/inputs/zeromq.rb +165 -0
  180. data/lib/logstash/kibana.rb +113 -0
  181. data/lib/logstash/loadlibs.rb +9 -0
  182. data/lib/logstash/logging.rb +89 -0
  183. data/lib/logstash/monkeypatches-for-bugs.rb +2 -0
  184. data/lib/logstash/monkeypatches-for-debugging.rb +47 -0
  185. data/lib/logstash/monkeypatches-for-performance.rb +66 -0
  186. data/lib/logstash/multiqueue.rb +53 -0
  187. data/lib/logstash/namespace.rb +16 -0
  188. data/lib/logstash/outputs/base.rb +120 -0
  189. data/lib/logstash/outputs/boundary.rb +116 -0
  190. data/lib/logstash/outputs/circonus.rb +78 -0
  191. data/lib/logstash/outputs/cloudwatch.rb +351 -0
  192. data/lib/logstash/outputs/csv.rb +55 -0
  193. data/lib/logstash/outputs/datadog.rb +93 -0
  194. data/lib/logstash/outputs/datadog_metrics.rb +123 -0
  195. data/lib/logstash/outputs/elasticsearch.rb +332 -0
  196. data/lib/logstash/outputs/elasticsearch/elasticsearch-template.json +44 -0
  197. data/lib/logstash/outputs/elasticsearch_http.rb +256 -0
  198. data/lib/logstash/outputs/elasticsearch_river.rb +214 -0
  199. data/lib/logstash/outputs/email.rb +299 -0
  200. data/lib/logstash/outputs/exec.rb +40 -0
  201. data/lib/logstash/outputs/file.rb +180 -0
  202. data/lib/logstash/outputs/ganglia.rb +75 -0
  203. data/lib/logstash/outputs/gelf.rb +208 -0
  204. data/lib/logstash/outputs/gemfire.rb +103 -0
  205. data/lib/logstash/outputs/google_bigquery.rb +570 -0
  206. data/lib/logstash/outputs/google_cloud_storage.rb +431 -0
  207. data/lib/logstash/outputs/graphite.rb +143 -0
  208. data/lib/logstash/outputs/graphtastic.rb +185 -0
  209. data/lib/logstash/outputs/hipchat.rb +80 -0
  210. data/lib/logstash/outputs/http.rb +142 -0
  211. data/lib/logstash/outputs/irc.rb +80 -0
  212. data/lib/logstash/outputs/jira.rb +109 -0
  213. data/lib/logstash/outputs/juggernaut.rb +105 -0
  214. data/lib/logstash/outputs/librato.rb +146 -0
  215. data/lib/logstash/outputs/loggly.rb +93 -0
  216. data/lib/logstash/outputs/lumberjack.rb +51 -0
  217. data/lib/logstash/outputs/metriccatcher.rb +103 -0
  218. data/lib/logstash/outputs/mongodb.rb +81 -0
  219. data/lib/logstash/outputs/nagios.rb +119 -0
  220. data/lib/logstash/outputs/nagios_nsca.rb +123 -0
  221. data/lib/logstash/outputs/null.rb +18 -0
  222. data/lib/logstash/outputs/opentsdb.rb +101 -0
  223. data/lib/logstash/outputs/pagerduty.rb +79 -0
  224. data/lib/logstash/outputs/pipe.rb +132 -0
  225. data/lib/logstash/outputs/rabbitmq.rb +96 -0
  226. data/lib/logstash/outputs/rabbitmq/bunny.rb +135 -0
  227. data/lib/logstash/outputs/rabbitmq/hot_bunnies.rb +1 -0
  228. data/lib/logstash/outputs/rabbitmq/march_hare.rb +143 -0
  229. data/lib/logstash/outputs/redis.rb +245 -0
  230. data/lib/logstash/outputs/riak.rb +152 -0
  231. data/lib/logstash/outputs/riemann.rb +109 -0
  232. data/lib/logstash/outputs/s3.rb +356 -0
  233. data/lib/logstash/outputs/sns.rb +124 -0
  234. data/lib/logstash/outputs/solr_http.rb +78 -0
  235. data/lib/logstash/outputs/sqs.rb +141 -0
  236. data/lib/logstash/outputs/statsd.rb +116 -0
  237. data/lib/logstash/outputs/stdout.rb +53 -0
  238. data/lib/logstash/outputs/stomp.rb +67 -0
  239. data/lib/logstash/outputs/syslog.rb +145 -0
  240. data/lib/logstash/outputs/tcp.rb +145 -0
  241. data/lib/logstash/outputs/udp.rb +38 -0
  242. data/lib/logstash/outputs/websocket.rb +46 -0
  243. data/lib/logstash/outputs/websocket/app.rb +29 -0
  244. data/lib/logstash/outputs/websocket/pubsub.rb +45 -0
  245. data/lib/logstash/outputs/xmpp.rb +78 -0
  246. data/lib/logstash/outputs/zabbix.rb +108 -0
  247. data/lib/logstash/outputs/zeromq.rb +125 -0
  248. data/lib/logstash/pipeline.rb +286 -0
  249. data/lib/logstash/plugin.rb +150 -0
  250. data/lib/logstash/plugin_mixins/aws_config.rb +93 -0
  251. data/lib/logstash/program.rb +15 -0
  252. data/lib/logstash/runner.rb +238 -0
  253. data/lib/logstash/sized_queue.rb +8 -0
  254. data/lib/logstash/test.rb +183 -0
  255. data/lib/logstash/threadwatchdog.rb +37 -0
  256. data/lib/logstash/time_addon.rb +33 -0
  257. data/lib/logstash/util.rb +106 -0
  258. data/lib/logstash/util/buftok.rb +139 -0
  259. data/lib/logstash/util/charset.rb +39 -0
  260. data/lib/logstash/util/fieldreference.rb +50 -0
  261. data/lib/logstash/util/password.rb +25 -0
  262. data/lib/logstash/util/prctl.rb +11 -0
  263. data/lib/logstash/util/relp.rb +326 -0
  264. data/lib/logstash/util/require-helper.rb +18 -0
  265. data/lib/logstash/util/socket_peer.rb +7 -0
  266. data/lib/logstash/util/zenoss.rb +566 -0
  267. data/lib/logstash/util/zeromq.rb +47 -0
  268. data/lib/logstash/version.rb +6 -0
  269. data/locales/en.yml +170 -0
  270. data/logstash-event.gemspec +29 -0
  271. data/logstash.gemspec +128 -0
  272. data/patterns/firewalls +60 -0
  273. data/patterns/grok-patterns +91 -0
  274. data/patterns/haproxy +37 -0
  275. data/patterns/java +3 -0
  276. data/patterns/linux-syslog +14 -0
  277. data/patterns/mcollective +1 -0
  278. data/patterns/mcollective-patterns +4 -0
  279. data/patterns/nagios +108 -0
  280. data/patterns/postgresql +3 -0
  281. data/patterns/redis +3 -0
  282. data/patterns/ruby +2 -0
  283. data/pkg/build.sh +135 -0
  284. data/pkg/centos/after-install.sh +1 -0
  285. data/pkg/centos/before-install.sh +10 -0
  286. data/pkg/centos/before-remove.sh +11 -0
  287. data/pkg/centos/sysconfig +15 -0
  288. data/pkg/debian/after-install.sh +5 -0
  289. data/pkg/debian/before-install.sh +13 -0
  290. data/pkg/debian/before-remove.sh +13 -0
  291. data/pkg/debian/build.sh +34 -0
  292. data/pkg/debian/debian/README +6 -0
  293. data/pkg/debian/debian/changelog +17 -0
  294. data/pkg/debian/debian/compat +1 -0
  295. data/pkg/debian/debian/control +16 -0
  296. data/pkg/debian/debian/copyright +27 -0
  297. data/pkg/debian/debian/dirs +19 -0
  298. data/pkg/debian/debian/docs +0 -0
  299. data/pkg/debian/debian/logstash.default +39 -0
  300. data/pkg/debian/debian/logstash.init +201 -0
  301. data/pkg/debian/debian/logstash.install +1 -0
  302. data/pkg/debian/debian/logstash.logrotate +9 -0
  303. data/pkg/debian/debian/logstash.postinst +68 -0
  304. data/pkg/debian/debian/logstash.postrm +23 -0
  305. data/pkg/debian/debian/manpage.1.ex +59 -0
  306. data/pkg/debian/debian/preinst.ex +37 -0
  307. data/pkg/debian/debian/prerm.ex +40 -0
  308. data/pkg/debian/debian/release.conf +5 -0
  309. data/pkg/debian/debian/rules +80 -0
  310. data/pkg/debian/debian/watch.ex +22 -0
  311. data/pkg/logrotate.conf +8 -0
  312. data/pkg/logstash-web.default +41 -0
  313. data/pkg/logstash-web.sysv.debian +201 -0
  314. data/pkg/logstash-web.upstart.ubuntu +18 -0
  315. data/pkg/logstash.default +45 -0
  316. data/pkg/logstash.sysv.debian +202 -0
  317. data/pkg/logstash.sysv.redhat +158 -0
  318. data/pkg/logstash.upstart.ubuntu +20 -0
  319. data/pkg/rpm/SOURCES/logstash.conf +26 -0
  320. data/pkg/rpm/SOURCES/logstash.init +80 -0
  321. data/pkg/rpm/SOURCES/logstash.logrotate +8 -0
  322. data/pkg/rpm/SOURCES/logstash.sysconfig +3 -0
  323. data/pkg/rpm/SOURCES/logstash.wrapper +105 -0
  324. data/pkg/rpm/SPECS/logstash.spec +180 -0
  325. data/pkg/rpm/readme.md +4 -0
  326. data/pkg/ubuntu/after-install.sh +7 -0
  327. data/pkg/ubuntu/before-install.sh +12 -0
  328. data/pkg/ubuntu/before-remove.sh +13 -0
  329. data/pull_release_note.rb +25 -0
  330. data/require-analyze.rb +22 -0
  331. data/spec/README.md +14 -0
  332. data/spec/codecs/edn.rb +40 -0
  333. data/spec/codecs/edn_lines.rb +53 -0
  334. data/spec/codecs/graphite.rb +96 -0
  335. data/spec/codecs/json.rb +57 -0
  336. data/spec/codecs/json_lines.rb +51 -0
  337. data/spec/codecs/json_spooler.rb +43 -0
  338. data/spec/codecs/msgpack.rb +39 -0
  339. data/spec/codecs/multiline.rb +60 -0
  340. data/spec/codecs/oldlogstashjson.rb +55 -0
  341. data/spec/codecs/plain.rb +35 -0
  342. data/spec/codecs/spool.rb +35 -0
  343. data/spec/conditionals/test.rb +323 -0
  344. data/spec/config.rb +31 -0
  345. data/spec/event.rb +165 -0
  346. data/spec/examples/fail2ban.rb +28 -0
  347. data/spec/examples/graphite-input.rb +41 -0
  348. data/spec/examples/mysql-slow-query.rb +70 -0
  349. data/spec/examples/parse-apache-logs.rb +66 -0
  350. data/spec/examples/parse-haproxy-logs.rb +115 -0
  351. data/spec/examples/syslog.rb +48 -0
  352. data/spec/filters/alter.rb +96 -0
  353. data/spec/filters/anonymize.rb +189 -0
  354. data/spec/filters/checksum.rb +41 -0
  355. data/spec/filters/clone.rb +67 -0
  356. data/spec/filters/collate.rb +122 -0
  357. data/spec/filters/csv.rb +174 -0
  358. data/spec/filters/date.rb +285 -0
  359. data/spec/filters/date_performance.rb +31 -0
  360. data/spec/filters/dns.rb +159 -0
  361. data/spec/filters/drop.rb +19 -0
  362. data/spec/filters/elapsed.rb +294 -0
  363. data/spec/filters/environment.rb +43 -0
  364. data/spec/filters/geoip.rb +62 -0
  365. data/spec/filters/grep.rb +342 -0
  366. data/spec/filters/grok.rb +473 -0
  367. data/spec/filters/grok/timeout2.rb +56 -0
  368. data/spec/filters/grok/timeouts.rb +39 -0
  369. data/spec/filters/i18n.rb +25 -0
  370. data/spec/filters/json.rb +72 -0
  371. data/spec/filters/json_encode.rb +37 -0
  372. data/spec/filters/kv.rb +403 -0
  373. data/spec/filters/metrics.rb +212 -0
  374. data/spec/filters/multiline.rb +119 -0
  375. data/spec/filters/mutate.rb +180 -0
  376. data/spec/filters/noop.rb +221 -0
  377. data/spec/filters/prune.rb +441 -0
  378. data/spec/filters/punct.rb +18 -0
  379. data/spec/filters/railsparallelrequest.rb +112 -0
  380. data/spec/filters/range.rb +169 -0
  381. data/spec/filters/split.rb +58 -0
  382. data/spec/filters/translate.rb +70 -0
  383. data/spec/filters/unique.rb +25 -0
  384. data/spec/filters/useragent.rb +42 -0
  385. data/spec/filters/xml.rb +157 -0
  386. data/spec/inputs/file.rb +107 -0
  387. data/spec/inputs/gelf.rb +52 -0
  388. data/spec/inputs/generator.rb +30 -0
  389. data/spec/inputs/imap.rb +60 -0
  390. data/spec/inputs/redis.rb +63 -0
  391. data/spec/inputs/relp.rb +70 -0
  392. data/spec/inputs/tcp.rb +101 -0
  393. data/spec/jar.rb +21 -0
  394. data/spec/outputs/csv.rb +266 -0
  395. data/spec/outputs/elasticsearch.rb +161 -0
  396. data/spec/outputs/elasticsearch_http.rb +240 -0
  397. data/spec/outputs/email.rb +173 -0
  398. data/spec/outputs/file.rb +82 -0
  399. data/spec/outputs/graphite.rb +236 -0
  400. data/spec/outputs/redis.rb +127 -0
  401. data/spec/speed.rb +20 -0
  402. data/spec/sqlite-test.rb +81 -0
  403. data/spec/support/LOGSTASH-733.rb +21 -0
  404. data/spec/support/LOGSTASH-820.rb +25 -0
  405. data/spec/support/akamai-grok.rb +26 -0
  406. data/spec/support/date-http.rb +17 -0
  407. data/spec/support/postwait1.rb +26 -0
  408. data/spec/support/pull375.rb +21 -0
  409. data/spec/test_utils.rb +125 -0
  410. data/spec/util/fieldeval_spec.rb +44 -0
  411. data/test/jenkins/config.xml.erb +74 -0
  412. data/test/jenkins/create-jobs.rb +23 -0
  413. data/test/jenkins/generatorjob.config.xml +66 -0
  414. data/tools/Gemfile +14 -0
  415. data/tools/Gemfile.jruby-1.9.lock +322 -0
  416. data/tools/Gemfile.rbx-2.1.lock +516 -0
  417. data/tools/Gemfile.ruby-1.9.1.lock +310 -0
  418. data/tools/Gemfile.ruby-2.0.0.lock +310 -0
  419. metadata +629 -0
@@ -0,0 +1,61 @@
1
+ # Contributing to logstash
2
+
3
+ All contributions are welcome: ideas, patches, documentation, bug reports,
4
+ complaints, etc!
5
+
6
+ Programming is not a required skill, and there are many ways to help out!
7
+ It is more important to us that you are able to contribute.
8
+
9
+ That said, some basic guidelines, which you are free to ignore :)
10
+
11
+ ## Want to learn?
12
+
13
+ Want to lurk about and see what others are doing with logstash?
14
+
15
+ * The irc channel (#logstash on irc.freenode.org) is a good place for this
16
+ * The [mailing list](http://groups.google.com/group/logstash-users) is also
17
+ great for learning from others.
18
+
19
+ ## Got Questions?
20
+
21
+ Have a problem you want logstash to solve for you?
22
+
23
+ * You can email the [mailing list](http://groups.google.com/group/logstash-users)
24
+ * alternately, you are welcome to join the IRC channel #logstash on
25
+ irc.freenode.org and ask for help there!
26
+
27
+ ## Have an Idea or Feature Request?
28
+
29
+ * File a ticket on [jira](https://logstash.jira.com/secure/Dashboard.jspa), or email the
30
+ [mailing list](http://groups.google.com/group/logstash-users), or email
31
+ me personally (jls@semicomplete.com) if that is more comfortable.
32
+
33
+ ## Something Not Working? Found a Bug?
34
+
35
+ If you think you found a bug, it probably is a bug.
36
+
37
+ * File it on [jira](https://logstash.jira.com/secure/Dashboard.jspa)
38
+ * or the [mailing list](http://groups.google.com/group/logstash-users).
39
+
40
+ # Contributing Documentation and Code Changes
41
+
42
+ If you have a bugfix or new feature that you would like to contribute to
43
+ logstash, and you think it will take more than a few minutes to produce the fix
44
+ (ie; write code), it is worth discussing the change with the logstash users and developers first! You can reach us via [jira](https://logstash.jira.com/secure/Dashboard.jspa), the [mailing list](http://groups.google.com/group/logstash-users), or via IRC (#logstash on freenode irc)
45
+
46
+ ## Contribution Steps
47
+
48
+ 1. Test your changes! Run the test suite ('make test')
49
+ 2. Please make sure you have signed our [Contributor License
50
+ Agreement](http://www.elasticsearch.org/contributor-agreement/). We are not
51
+ asking you to assign copyright to us, but to give us the right to distribute
52
+ your code without restriction. We ask this of all contributors in order to
53
+ assure our users of the origin and continuing existence of the code. You
54
+ only need to sign the CLA once.
55
+ 3. Send a pull request! Push your changes to your fork of the repository and
56
+ [submit a pull
57
+ request](https://help.github.com/articles/using-pull-requests). In the pull
58
+ request, describe what your changes do and mention any jira issues related
59
+ to the pull request.
60
+
61
+
@@ -0,0 +1,79 @@
1
+ The following is a list of people who have contributed ideas, code, bug
2
+ reports, or in general have helped logstash along its way.
3
+
4
+ Contributors:
5
+ * Jordan Sissel (jordansissel)
6
+ * Pete Fritchman (fetep)
7
+ * Brice Figureau (masterzen)
8
+ * Vladimir Vuksan (vvuksan)
9
+ * Alexandre Dulaunoy (adulau)
10
+ * Ryan Ausanka-Crues (rausanka) / tello.com (startupseven)
11
+ * Piotr Usewicz (pusewicz)
12
+ * Charles Duffy (charles-dyfis-net)
13
+ * Naresh V (nareshov)
14
+ * John Vincent (lusis)
15
+ * Bob Corsaro (dokipen)
16
+ * kjoconnor
17
+ * Evgeny Zislis (kesor)
18
+ * Johan Venter
19
+ * Jeff Buchbinder (freemed)
20
+ * Dan Peterson (dpiddy)
21
+ * Nick Ethier (nickethier)
22
+ * Joel Merrick (joelio)
23
+ * Michael Leinartas (mleinart)
24
+ * Jesse Newland (jnewland)
25
+ * Yuval Oren (yuvaloren)
26
+ * cmclaughlin
27
+ * Graham Bleach (bleach)
28
+ * Jan Seidl (jseidl)
29
+ * Jean-Luc Geering (jlgeering)
30
+ * Avishai Ish-Shalom (avishai-ish-shalom)
31
+ * turtlebender
32
+ * Nick Padilla (NickPadilla)
33
+ * tucker250
34
+ * gja
35
+ * Max Horbul (mhorbul)
36
+ * Aaron Mildenstein (untergeek)
37
+ * Greg Mefford (gregmefford)
38
+ * JB Barth (jbbarth)
39
+ * Tom Hodder (tolland)
40
+ * David Castro (arimus)
41
+ * Parker DeBardelaben (parkerd)
42
+ * Max Horbul (mhorbul)
43
+ * Harlan Barnes (harlanbarnes)
44
+ * Jeremiah Shirk (jeremiahshirk)
45
+ * Patrick Debois (jedi4ever)
46
+ * bodik
47
+ * Philippe Weber
48
+ * Marc Huffnagle (mhuffnagle)
49
+ * Oliver Gorwits (ollyg)
50
+ * Rashid Khan (rashidkpc)
51
+ * squiddle
52
+ * Andrew Rowson (growse)
53
+ * Cameron Stokes (clstokes)
54
+ * Francesco Salbaroli (wathrog)
55
+ * goblin
56
+ * Mike Worth (MikeWorth)
57
+ * Nic Williams (drnic)
58
+ * Tomas Doran (bobtfish)
59
+ * Xabier de Zuazo (zuazo)
60
+ * Louis Zuckerman (semiosis)
61
+ * Richard Pijnenburg (electrical)
62
+ * James Turnbull (jamesturnbull)
63
+ * Neil Prosser (neilprosser)
64
+ * Alex Dean (alexdean)
65
+ * Jonathan Quail (jonathanq)
66
+ * Kushal Pisavadia (KushalP)
67
+ * Gang Chen (goncha)
68
+ * Michael Klishin (michaelklishin)
69
+ * Marc Fournier (mfournier)
70
+ * Helmut Duregger (hduregger)
71
+ * Matt Dainty (bodgit)
72
+ * Juarez Bochi (jbochi)
73
+ * Bernd Ahlers (bernd)
74
+ * Andrea Forni (andreaforni)
75
+
76
+ Note: If you've sent me patches, bug reports, or otherwise contributed to
77
+ logstash, and you aren't on the list above and want to be, please let me know
78
+ and I'll make sure you're here. Contributions from folks like you are what make
79
+ open source awesome.
data/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ Copyright 2009-2013 Jordan Sissel, Pete Fritchman, and contributors.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+
@@ -0,0 +1,460 @@
1
+ # Requirements to build:
2
+ # rsync
3
+ # wget or curl
4
+ #
5
+ JRUBY_VERSION=1.7.8
6
+ ELASTICSEARCH_VERSION=0.90.9
7
+
8
+ WITH_JRUBY=java -jar $(shell pwd)/$(JRUBY) -S
9
+ JRUBY=vendor/jar/jruby-complete-$(JRUBY_VERSION).jar
10
+ JRUBY_URL=http://jruby.org.s3.amazonaws.com/downloads/$(JRUBY_VERSION)/jruby-complete-$(JRUBY_VERSION).jar
11
+ JRUBY_CMD=java -jar $(JRUBY)
12
+
13
+ ELASTICSEARCH_URL=http://download.elasticsearch.org/elasticsearch/elasticsearch
14
+ ELASTICSEARCH=vendor/jar/elasticsearch-$(ELASTICSEARCH_VERSION)
15
+ TYPESDB=vendor/collectd/types.db
16
+ COLLECTD_VERSION=5.4.0
17
+ TYPESDB_URL=https://collectd.org/files/collectd-$(COLLECTD_VERSION).tar.gz
18
+ GEOIP=vendor/geoip/GeoLiteCity.dat
19
+ GEOIP_URL=http://logstash.objects.dreamhost.com/maxmind/GeoLiteCity-2013-01-18.dat.gz
20
+ KIBANA_URL=https://download.elasticsearch.org/kibana/kibana/kibana-latest.tar.gz
21
+ PLUGIN_FILES=$(shell git ls-files | egrep '^lib/logstash/(inputs|outputs|filters|codecs)/[^/]+$$' | egrep -v '/(base|threadable).rb$$|/inputs/ganglia/')
22
+ QUIET=@
23
+ ifeq (@,$(QUIET))
24
+ QUIET_OUTPUT=> /dev/null 2>&1
25
+ endif
26
+
27
+ WGET=$(shell which wget 2>/dev/null)
28
+ CURL=$(shell which curl 2>/dev/null)
29
+
30
+ # OS-specific options
31
+ TARCHECK=$(shell tar --help|grep wildcard|wc -l|tr -d ' ')
32
+ ifeq (0, $(TARCHECK))
33
+ TAR_OPTS=
34
+ else
35
+ TAR_OPTS=--wildcards
36
+ endif
37
+
38
+ #spec/outputs/graphite.rb spec/outputs/email.rb)
39
+ default:
40
+ @echo "Make targets you might be interested in:"
41
+ @echo " flatjar -- builds the flatjar jar"
42
+ @echo " flatjar-test -- runs the test suite against the flatjar"
43
+ @echo " jar -- builds the monolithic jar"
44
+ @echo " jar-test -- runs the test suite against the monolithic jar"
45
+
46
+ TESTS=$(wildcard spec/inputs/gelf.rb spec/support/*.rb spec/filters/*.rb spec/examples/*.rb spec/codecs/*.rb spec/conditionals/*.rb spec/event.rb spec/jar.rb)
47
+
48
+ # The 'version' is generated based on the logstash version, git revision, etc.
49
+ .VERSION.mk: REVISION=$(shell git rev-parse --short HEAD | tr -d ' ')
50
+ .VERSION.mk: RELEASE=$(shell awk -F\" '/LOGSTASH_VERSION/ {print $$2}' lib/logstash/version.rb | tr -d ' ')
51
+ #.VERSION.mk: TAGGED=$(shell git tag --points-at HEAD | egrep '^v[0-9]')
52
+ .VERSION.mk: DEV=$(shell echo $RELEASE | egrep '\.dev$$')
53
+ .VERSION.mk: MODIFIED=$(shell git diff --shortstat --exit-code > /dev/null ; echo $$?)
54
+ .VERSION.mk:
55
+ $(QUIET)echo "RELEASE=${RELEASE}" > $@
56
+ $(QUIET)echo "REVISION=${REVISION}" >> $@
57
+ $(QUIET)echo "DEV=${DEV}" >> $@
58
+ $(QUIET)echo "MODIFIED=${MODIFIED}" >> $@
59
+ $(QUIET)if [ -z "${DEV}" ] ; then \
60
+ if [ "${MODIFIED}" -eq 1 ] ; then \
61
+ echo "VERSION=${RELEASE}-modified" ; \
62
+ else \
63
+ echo "VERSION=${RELEASE}" ; \
64
+ fi ; \
65
+ else \
66
+ if [ "${MODIFIED}" -eq 1 ] ; then \
67
+ echo "VERSION=${RELEASE}-${REVISION}-modified" ; \
68
+ else \
69
+ echo "VERSION=${RELEASE}-${REVISION}" ; \
70
+ fi ; \
71
+ fi >> $@
72
+
73
+ -include .VERSION.mk
74
+
75
+ version:
76
+ @echo "Version: $(VERSION)"
77
+
78
+ # Figure out if we're using wget or curl
79
+ .PHONY: wget-or-curl
80
+ wget-or-curl:
81
+ ifeq ($(CURL),)
82
+ ifeq ($(WGET),)
83
+ @echo "wget or curl are required."
84
+ exit 1
85
+ else
86
+ DOWNLOAD_COMMAND=wget -q --no-check-certificate -O
87
+ endif
88
+ else
89
+ DOWNLOAD_COMMAND=curl -s -L -k -o
90
+ endif
91
+
92
+ # Compile config grammar (ragel -> ruby)
93
+ .PHONY: compile-grammar
94
+ compile-grammar: lib/logstash/config/grammar.rb
95
+ lib/logstash/config/grammar.rb: lib/logstash/config/grammar.treetop
96
+ $(QUIET)$(MAKE) -C lib/logstash/config grammar.rb
97
+
98
+ .PHONY: clean
99
+ clean:
100
+ @echo "=> Cleaning up"
101
+ -$(QUIET)rm -rf .bundle
102
+ -$(QUIET)rm -rf build
103
+ -$(QUIET)rm -f pkg/*.deb
104
+ -$(QUIET)rm .VERSION.mk
105
+
106
+ .PHONY: vendor-clean
107
+ vendor-clean:
108
+ -$(QUIET)rm -rf vendor/kibana vendor/geoip vendor/collectd
109
+ -$(QUIET)rm -rf vendor/jar vendor/ua-parser
110
+
111
+ .PHONY: clean-vendor
112
+ clean-vendor:
113
+ -$(QUIET)rm -rf vendor
114
+
115
+ .PHONY: compile
116
+ compile: compile-grammar compile-runner | build/ruby
117
+
118
+ .PHONY: compile-runner
119
+ compile-runner: build/ruby/logstash/runner.class
120
+ build/ruby/logstash/runner.class: lib/logstash/runner.rb | build/ruby $(JRUBY)
121
+ $(QUIET)(cd lib; java -jar ../$(JRUBY) -rjruby/jrubyc -e 'exit JRuby::Compiler::compile_argv(ARGV)' -- -t ../build/ruby logstash/runner.rb)
122
+
123
+ .PHONY: copy-ruby-files
124
+ copy-ruby-files: | build/ruby
125
+ @# Copy lib/ and test/ files to the root
126
+ $(QUIET)rsync -a --include "*/" --include "*.rb" --exclude "*" ./lib/ ./test/ ./build/ruby
127
+ $(QUIET)rsync -a ./spec ./build/ruby
128
+ $(QUIET)rsync -a ./locales ./build/ruby
129
+ @# Delete any empty directories copied by rsync.
130
+ $(QUIET)find ./build/ruby -type d -empty -delete
131
+
132
+ vendor:
133
+ $(QUIET)mkdir $@
134
+
135
+ vendor/jar: | vendor
136
+ $(QUIET)mkdir $@
137
+
138
+ vendor-jruby: $(JRUBY)
139
+
140
+ $(JRUBY): | vendor/jar
141
+ $(QUIET)echo " ==> Downloading jruby $(JRUBY_VERSION)"
142
+ $(QUIET)$(DOWNLOAD_COMMAND) $@ $(JRUBY_URL)
143
+
144
+ vendor/jar/elasticsearch-$(ELASTICSEARCH_VERSION).tar.gz: | wget-or-curl vendor/jar
145
+ @echo "=> Fetching elasticsearch"
146
+ $(QUIET)$(DOWNLOAD_COMMAND) $@ $(ELASTICSEARCH_URL)/elasticsearch-$(ELASTICSEARCH_VERSION).tar.gz
147
+
148
+ vendor/jar/graphtastic-rmiclient.jar: | wget-or-curl vendor/jar
149
+ @echo "=> Fetching graphtastic rmi client jar"
150
+ $(QUIET)$(DOWNLOAD_COMMAND) $@ http://cloud.github.com/downloads/NickPadilla/GraphTastic/graphtastic-rmiclient.jar
151
+
152
+ .PHONY: vendor-elasticsearch
153
+ vendor-elasticsearch: $(ELASTICSEARCH)
154
+ $(ELASTICSEARCH): $(ELASTICSEARCH).tar.gz | vendor/jar
155
+ @echo "=> Pulling the jars out of $<"
156
+ $(QUIET)tar -C $(shell dirname $@) -xf $< $(TAR_OPTS) --exclude '*sigar*' \
157
+ 'elasticsearch-$(ELASTICSEARCH_VERSION)/lib/*.jar'
158
+
159
+ vendor/geoip: | vendor
160
+ $(QUIET)mkdir $@
161
+
162
+ .PHONY: vendor-geoip
163
+ vendor-geoip: $(GEOIP)
164
+ $(GEOIP): | vendor/geoip
165
+ $(QUIET)$(DOWNLOAD_COMMAND) $@.tmp.gz $(GEOIP_URL)
166
+ $(QUIET)gzip -dc $@.tmp.gz > $@.tmp
167
+ $(QUIET)rm "$@.tmp.gz"
168
+ $(QUIET)mv $@.tmp $@
169
+
170
+ vendor/collectd: | vendor
171
+ $(QUIET)mkdir $@
172
+
173
+ .PHONY: vendor-collectd
174
+ vendor-collectd: $(TYPESDB)
175
+ $(TYPESDB): | vendor/collectd
176
+ $(QUIET)$(DOWNLOAD_COMMAND) $@.tar.gz $(TYPESDB_URL)
177
+ $(QUIET)tar zxf $@.tar.gz -O "collectd-$(COLLECTD_VERSION)/src/types.db" > $@
178
+ $(QUIET)rm $@.tar.gz
179
+
180
+ # Always run vendor/bundle
181
+ .PHONY: fix-bundler
182
+ fix-bundler:
183
+ -$(QUIET)rm -rf .bundle
184
+
185
+ .PHONY: vendor-gems
186
+ vendor-gems: | vendor/bundle
187
+
188
+ .PHONY: vendor/bundle
189
+ vendor/bundle: | vendor $(JRUBY)
190
+ @echo "=> Ensuring ruby gems dependencies are in $@..."
191
+ $(QUIET)USE_JRUBY=1 bin/logstash deps $(QUIET_OUTPUT)
192
+ @# Purge any junk that fattens our jar without need!
193
+ @# The riak gem includes previous gems in the 'pkg' dir. :(
194
+ -$(QUIET)rm -rf $@/jruby/1.9/gems/riak-client-1.0.3/pkg
195
+ @# Purge any rspec or test directories
196
+ -$(QUIET)rm -rf $@/jruby/1.9/gems/*/spec $@/jruby/1.9/gems/*/test
197
+ @# Purge any comments in ruby code.
198
+ @#-find $@/jruby/1.9/gems/ -name '*.rb' | xargs -n1 sed -i -re '/^[ \t]*#/d; /^[ \t]*$$/d'
199
+
200
+ .PHONY: build
201
+ build:
202
+ -$(QUIET)mkdir -p $@
203
+
204
+ build/ruby: | build
205
+ -$(QUIET)mkdir -p $@
206
+
207
+ # TODO(sissel): Update this to be like.. functional.
208
+ # TODO(sissel): Skip sigar?
209
+ # Run this one always? Hmm..
210
+ .PHONY: build/monolith
211
+ build/monolith: $(ELASTICSEARCH) $(JRUBY) $(GEOIP) $(TYPESDB) vendor-gems | build
212
+ build/monolith: vendor/ua-parser/regexes.yaml
213
+ build/monolith: vendor/kibana
214
+ build/monolith: compile copy-ruby-files vendor/jar/graphtastic-rmiclient.jar
215
+ -$(QUIET)mkdir -p $@
216
+ @# Unpack all the 3rdparty jars and any jars in gems
217
+ $(QUIET)find $$PWD/vendor/bundle $$PWD/vendor/jar -name '*.jar' \
218
+ | (cd $@; xargs -n1 jar xf)
219
+ @# Merge all service file in all 3rdparty jars
220
+ $(QUIET)mkdir -p $@/META-INF/services/
221
+ $(QUIET)find $$PWD/vendor/bundle $$PWD/vendor/jar -name '*.jar' \
222
+ | xargs $(JRUBY_CMD) extract_services.rb -o $@/META-INF/services
223
+ @# copy openssl/lib/shared folders/files to root of jar
224
+ @#- need this for openssl to work with JRuby
225
+ $(QUIET)mkdir -p $@/openssl
226
+ $(QUIET)mkdir -p $@/jopenssl
227
+ $(QUIET)cp -r $$PWD/vendor/bundle/jruby/1.9/gems/jruby-openss*/lib/shared/openssl/* $@/openssl
228
+ $(QUIET)cp -r $$PWD/vendor/bundle/jruby/1.9/gems/jruby-openss*/lib/shared/jopenssl/* $@/jopenssl
229
+ $(QUIET)cp -r $$PWD/vendor/bundle/jruby/1.9/gems/jruby-openss*/lib/shared/openssl.rb $@/openssl.rb
230
+ @# Purge any extra files we don't need in META-INF (like manifests and
231
+ @# signature files)
232
+ -$(QUIET)rm -f $@/META-INF/*.LIST
233
+ -$(QUIET)rm -f $@/META-INF/*.MF
234
+ -$(QUIET)rm -f $@/META-INF/*.RSA
235
+ -$(QUIET)rm -f $@/META-INF/*.SF
236
+ -$(QUIET)rm -f $@/META-INF/NOTICE $@/META-INF/NOTICE.txt
237
+ -$(QUIET)rm -f $@/META-INF/LICENSE $@/META-INF/LICENSE.txt
238
+ -$(QUIET)mkdir -p $@/vendor/ua-parser
239
+ -$(QUIET)cp vendor/ua-parser/regexes.yaml $@/vendor/ua-parser
240
+ $(QUIET)cp $(GEOIP) $@/
241
+ $(QUIET)cp $(TYPESDB) $@/
242
+ $(QUIET)cp lib/logstash/outputs/elasticsearch/elasticsearch-template.json $@/
243
+ -$(QUIET)rsync -a vendor/kibana/ $@/vendor/kibana/
244
+
245
+ vendor/ua-parser/: | build
246
+ $(QUIET)mkdir $@
247
+
248
+ vendor/ua-parser/regexes.yaml: | vendor/ua-parser/
249
+ @echo "=> Fetching ua-parser regexes.yaml"
250
+ $(QUIET)$(DOWNLOAD_COMMAND) $@ https://raw.github.com/tobie/ua-parser/master/regexes.yaml
251
+
252
+ # Learned how to do pack gems up into the jar mostly from here:
253
+ # http://blog.nicksieger.com/articles/2009/01/10/jruby-1-1-6-gems-in-a-jar
254
+ VENDOR_DIR=vendor/bundle/jruby/1.9
255
+ jar: build/logstash-$(VERSION)-monolithic.jar
256
+ build/logstash-$(VERSION)-monolithic.jar: | build/monolith
257
+ build/logstash-$(VERSION)-monolithic.jar: JAR_ARGS=-C build/ruby .
258
+ build/logstash-$(VERSION)-monolithic.jar: JAR_ARGS+=-C build/monolith .
259
+ build/logstash-$(VERSION)-monolithic.jar: JAR_ARGS+=-C $(VENDOR_DIR) gems
260
+ build/logstash-$(VERSION)-monolithic.jar: JAR_ARGS+=-C $(VENDOR_DIR) specifications
261
+ build/logstash-$(VERSION)-monolithic.jar: JAR_ARGS+=-C lib logstash/certs
262
+ build/logstash-$(VERSION)-monolithic.jar: JAR_ARGS+=patterns
263
+ build/logstash-$(VERSION)-monolithic.jar:
264
+ $(QUIET)rm -f $@
265
+ $(QUIET)jar cfe $@ logstash.runner $(JAR_ARGS)
266
+ @echo "Created $@"
267
+
268
+ .PHONY: build/logstash-$(VERSION)-monolithic.jar
269
+
270
+ build/flatgems: | build vendor/bundle
271
+ mkdir $@
272
+ for i in $(VENDOR_DIR)/gems/*/lib $(VENDOR_DIR)/gems/*/data; do \
273
+ rsync -a $$i/ $@/$$(basename $$i) ; \
274
+ done
275
+ @# Until I implement something that looks at the 'require_paths' from
276
+ @# all the gem specs.
277
+ $(QUIET)rsync -a $(VENDOR_DIR)/gems/jruby-openssl-*/lib/shared/jopenssl.jar $@/lib
278
+ #$(QUIET)rsync -a $(VENDOR_DIR)/gems/sys-uname-*/lib/unix/ $@/lib
279
+ @# Other lame hacks to get crap to work.
280
+ $(QUIET)rsync -a $(VENDOR_DIR)/gems/sass-*/VERSION_NAME $@/root/
281
+ $(QUIET)rsync -a $(VENDOR_DIR)/gems/user_agent_parser-*/vendor/ua-parser $@/vendor
282
+
283
+ flatjar-test:
284
+ # chdir away from the project directory to make sure things work in isolation.
285
+ cd / && GEM_HOME= GEM_PATH= java -jar $(PWD)/build/logstash-$(VERSION)-flatjar.jar rspec $(TESTS) --fail-fast
286
+ #cd / && GEM_HOME= GEM_PATH= java -jar $(PWD)/build/logstash-$(VERSION)-flatjar.jar rspec spec/jar.rb
287
+
288
+ jar-test:
289
+ cd / && GEM_HOME= GEM_PATH= java -jar $(PWD)/build/logstash-$(VERSION)-monolithic.jar rspec $(TESTS) --fail-fast
290
+ #cd / && GEM_HOME= GEM_PATH= java -jar $(PWD)/build/logstash-$(VERSION)-monolithic.jar rspec spec/jar.rb
291
+
292
+ flatjar-test-and-report:
293
+ GEM_HOME= GEM_PATH= java -jar build/logstash-$(VERSION)-flatjar.jar rspec $(TESTS) --format h --out build/results.flatjar.html
294
+
295
+ jar-test-and-report:
296
+ GEM_HOME= GEM_PATH= java -jar build/logstash-$(VERSION)-monolithic.jar rspec $(TESTS) --format h --out build/results.monolithic.html
297
+
298
+ flatjar: build/logstash-$(VERSION)-flatjar.jar
299
+ build/jar: | build build/flatgems build/monolith
300
+ $(QUIET)mkdir build/jar
301
+ $(QUIET)rsync -a build/flatgems/root/ build/flatgems/lib/ build/monolith/ build/ruby/ patterns build/flatgems/data build/jar/
302
+ $(QUIET)(cd lib; rsync -a --delete logstash/certs/ ../build/jar/logstash/certs)
303
+
304
+ build/logstash-$(VERSION)-flatjar.jar: | build/jar
305
+ $(QUIET)rm -f $@
306
+ $(QUIET)jar cfe $@ logstash.runner -C build/jar .
307
+ @echo "Created $@"
308
+
309
+ update-jar: copy-ruby-files compile build/ruby/logstash/runner.class
310
+ $(QUIET)jar uf build/logstash-$(VERSION)-monolithic.jar -C build/ruby .
311
+
312
+ update-flatjar: copy-ruby-files compile build/ruby/logstash/runner.class
313
+ $(QUIET)jar uf build/logstash-$(VERSION)-flatjar.jar -C build/ruby .
314
+
315
+ .PHONY: test
316
+ test: | $(JRUBY) vendor-elasticsearch vendor-geoip vendor-collectd
317
+ GEM_HOME= GEM_PATH= bin/logstash deps
318
+ GEM_HOME= GEM_PATH= bin/logstash rspec --order rand --fail-fast $(TESTS)
319
+
320
+
321
+ .PHONY: docs
322
+ docs: docgen doccopy docindex
323
+
324
+ doccopy: $(addprefix build/,$(shell git ls-files | grep '^docs/')) | build/docs
325
+ docindex: build/docs/index.html
326
+
327
+ docgen: $(addprefix build/docs/,$(subst lib/logstash/,,$(subst .rb,.html,$(PLUGIN_FILES))))
328
+
329
+ build/docs: build
330
+ -$(QUIET)mkdir $@
331
+
332
+ build/docs/inputs build/docs/filters build/docs/outputs build/docs/codecs: | build/docs
333
+ -$(QUIET)mkdir $@
334
+
335
+ # bluecloth gem doesn't work on jruby. Use ruby.
336
+ build/docs/inputs/%.html: lib/logstash/inputs/%.rb docs/docgen.rb docs/plugin-doc.html.erb | build/docs/inputs
337
+ $(QUIET)ruby docs/docgen.rb -o build/docs $<
338
+ $(QUIET)sed -i -re 's/%VERSION%/$(VERSION)/g' $@
339
+ $(QUIET)sed -i -re 's/%ELASTICSEARCH_VERSION%/$(ELASTICSEARCH_VERSION)/g' $@
340
+ build/docs/filters/%.html: lib/logstash/filters/%.rb docs/docgen.rb docs/plugin-doc.html.erb | build/docs/filters
341
+ $(QUIET)ruby docs/docgen.rb -o build/docs $<
342
+ $(QUIET)sed -i -re 's/%VERSION%/$(VERSION)/g' $@
343
+ $(QUIET)sed -i -re 's/%ELASTICSEARCH_VERSION%/$(ELASTICSEARCH_VERSION)/g' $@
344
+ build/docs/outputs/%.html: lib/logstash/outputs/%.rb docs/docgen.rb docs/plugin-doc.html.erb | build/docs/outputs
345
+ $(QUIET)ruby docs/docgen.rb -o build/docs $<
346
+ $(QUIET)sed -i -re 's/%VERSION%/$(VERSION)/g' $@
347
+ $(QUIET)sed -i -re 's/%ELASTICSEARCH_VERSION%/$(ELASTICSEARCH_VERSION)/g' $@
348
+ build/docs/codecs/%.html: lib/logstash/codecs/%.rb docs/docgen.rb docs/plugin-doc.html.erb | build/docs/codecs
349
+ $(QUIET)ruby docs/docgen.rb -o build/docs $<
350
+ $(QUIET)sed -i -re 's/%VERSION%/$(VERSION)/g' $@
351
+
352
+ build/docs/%: docs/% lib/logstash/version.rb Makefile
353
+ @echo "Copying $< (to $@)"
354
+ -$(QUIET)mkdir -p $(shell dirname $@)
355
+ $(QUIET)cp $< $@
356
+ $(QUIET)case "$(suffix $<)" in \
357
+ .gz|.bz2|.png|.jpg) ;; \
358
+ *) \
359
+ sed -i -re 's/%VERSION%/$(VERSION)/g' $@ ; \
360
+ sed -i -re 's/%ELASTICSEARCH_VERSION%/$(ELASTICSEARCH_VERSION)/g' $@ ; \
361
+ ;; \
362
+ esac
363
+
364
+ build/docs/index.html: $(addprefix build/docs/,$(subst lib/logstash/,,$(subst .rb,.html,$(PLUGIN_FILES))))
365
+ build/docs/index.html: docs/generate_index.rb lib/logstash/version.rb docs/index.html.erb Makefile
366
+ @echo "Building documentation index.html"
367
+ $(QUIET)ruby $< build/docs > $@
368
+ $(QUIET)sed -i -re 's/%VERSION%/$(VERSION)/g' $@
369
+ $(QUIET)sed -i -re 's/%ELASTICSEARCH_VERSION%/$(ELASTICSEARCH_VERSION)/g' $@
370
+
371
+ rpm: build/logstash-$(VERSION)-monolithic.jar
372
+ rm -rf build/root
373
+ mkdir -p build/root/opt/logstash
374
+ cp -rp patterns build/root/opt/logstash/patterns
375
+ cp build/logstash-$(VERSION)-monolithic.jar build/root/opt/logstash
376
+ (cd build; fpm -t rpm -d jre -a noarch -n logstash -v $(VERSION) -s dir -C root opt)
377
+
378
+ .PHONY: patterns
379
+ patterns:
380
+ curl https://nodeload.github.com/logstash/grok-patterns/tarball/master | tar zx
381
+ mv logstash-grok-patterns*/* patterns/
382
+ rm -rf logstash-grok-patterns*
383
+
384
+ ## JIRA Interaction section
385
+ JIRACLI=/path/to/your/jira-cli-3.1.0/jira.sh
386
+
387
+ sync-jira-components: $(addprefix create/jiracomponent/,$(subst lib/logstash/,,$(subst .rb,,$(PLUGIN_FILES))))
388
+ -$(QUIET)$(JIRACLI) --action run --file tmp_jira_action_list --continue > /dev/null 2>&1
389
+ $(QUIET)rm tmp_jira_action_list
390
+
391
+ create/jiracomponent/%:
392
+ $(QUIET)echo "--action addComponent --project LOGSTASH --name $(subst create/jiracomponent/,,$@)" >> tmp_jira_action_list
393
+
394
+ ## Release note section (up to you if/how/when to integrate in docs)
395
+ # Collect the details of:
396
+ # - merged pull request from GitHub since last release
397
+ # - issues for FixVersion from JIRA
398
+
399
+ # Note on used Github logic
400
+ # We parse the commit between the last tag (should be the last release) and HEAD
401
+ # to extract all the notice about merged pull requests.
402
+
403
+ # Note on used JIRA release note URL
404
+ # The JIRA Release note list all issues (even open ones)
405
+ # with Fix Version assigned to target version
406
+ # So one must verify manually that there is no open issue left (TODO use JIRACLI)
407
+
408
+ # This is the ID for a version item in jira, can be obtained by CLI
409
+ # or through the Version URL https://logstash.jira.com/browse/LOGSTASH/fixforversion/xxx
410
+ JIRA_VERSION_ID=10820
411
+
412
+ releaseNote:
413
+ -$(QUIET)rm releaseNote.html
414
+ $(QUIET)curl -si "https://logstash.jira.com/secure/ReleaseNote.jspa?version=$(JIRA_VERSION_ID)&projectId=10020" | sed -n '/<textarea.*>/,/<\/textarea>/p' | grep textarea -v >> releaseNote.html
415
+ $(QUIET)ruby pull_release_note.rb
416
+
417
+ package:
418
+ [ ! -f build/logstash-$(VERSION)-flatjar.jar ] \
419
+ && make build/logstash-$(VERSION)-flatjar.jar ; \
420
+ (cd pkg; \
421
+ ./build.sh ubuntu 12.10; \
422
+ ./build.sh centos 6; \
423
+ ./build.sh debian 6; \
424
+ )
425
+
426
+ vendor/kibana: | vendor
427
+ @echo "=> Fetching kibana"
428
+ $(QUIET)mkdir vendor/kibana || true
429
+ $(DOWNLOAD_COMMAND) - $(KIBANA_URL) | tar -C $@ -zx --strip-components=1
430
+
431
+ build/tarball: | build
432
+ mkdir $@
433
+ build/tarball/logstash-%: | build/tarball
434
+ mkdir $@
435
+
436
+ show:
437
+ echo $(VERSION)
438
+
439
+ .PHONY: prepare-tarball
440
+ prepare-tarball tarball: WORKDIR=build/tarball/logstash-$(VERSION)
441
+ prepare-tarball: vendor/kibana $(ELASTICSEARCH) $(JRUBY) $(GEOIP) $(TYPESDB) vendor-gems
442
+ prepare-tarball: vendor/ua-parser/regexes.yaml
443
+ prepare-tarball:
444
+ @echo "=> Preparing tarball"
445
+ $(QUIET)$(MAKE) $(WORKDIR)
446
+ $(QUIET)rsync -a --relative bin lib spec locales patterns vendor/bundle/jruby vendor/geoip vendor/jar vendor/kibana vendor/ua-parser vendor/collectd LICENSE README.md --exclude 'vendor/bundle/jruby/1.9/cache' --exclude 'vendor/bundle/jruby/1.9/gems/*/doc' --exclude 'vendor/jar/elasticsearch-$(ELASTICSEARCH_VERSION).tar.gz' $(WORKDIR)
447
+ $(QUIET)sed -i -e 's/^LOGSTASH_VERSION = .*/LOGSTASH_VERSION = "$(VERSION)"/' $(WORKDIR)/lib/logstash/version.rb
448
+
449
+ .PHONY: tarball
450
+ tarball: | build/logstash-$(VERSION).tar.gz
451
+ build/logstash-$(VERSION).tar.gz: | prepare-tarball
452
+ $(QUIET)tar -C $$(dirname $(WORKDIR)) -zcf $@ $$(basename $(WORKDIR))
453
+ @echo "=> tarball ready: $@"
454
+
455
+ .PHONY: tarball-test
456
+ tarball-test: #build/logstash-$(VERSION).tar.gz
457
+ $(QUIET)-rm -rf build/test-tarball/
458
+ $(QUIET)mkdir -p build/test-tarball/
459
+ tar -C build/test-tarball --strip-components 1 -xf build/logstash-$(VERSION).tar.gz
460
+ (cd build/test-tarball; bin/logstash rspec $(TESTS) --fail-fast)