简体   繁体   English

Logstash输入插件生成器生成用于弹性搜索的动态数据

[英]Logstash input plugin generator to generate dynamic data for elastic search

I want to be able to generate large amount of data for a poc with Elastic Search. 我希望能够通过Elastic Search为POC生成大量数据。 I came across this input plugin "generator". 我遇到了这个输入插件“ generator”。 But from what I see in the documentation it can only generate statically specified data repeatedly. 但是从我在文档中看到的来看,它只能重复生成静态指定的数据。 Does anyone know how to generate the dynamic data - that is it should emit new data everytime. 有谁知道如何生成动态数据-也就是说它应该每次都发出新数据。 I am referring to this https://www.elastic.co/guide/en/logstash/current/plugins-inputs-generator.html 我指的是这个https://www.elastic.co/guide/en/logstash/current/plugins-inputs-generator.html

Is it possible to use some kind of a regex in the value for "lines" . 是否可以在“ lines”的值中使用某种正则表达式。 Any help will be greatly appreciated. 任何帮助将不胜感激。

Thanks. 谢谢。

Instead on generator you can send random generated data to logstash with tcp input plugin 而是在generator您可以使用tcp输入插件将随机生成的数据发送到logstash

input { 
       tcp { type => "test" port => 50005 }
      }

Then send random data generated by urandom with nc : 然后使用nc发送urandom生成的随机数据:

cat /dev/urandom| tr -dc 'a-zA-Z0-9-_!@#$%^&*()_+{}|:<>?='|fold -w 100 | pv -L 20k | nc localhost 50005

pv will limit data rate 20KB/s . pv将限制数据速率20KB/s Change the value accordingly for your need. 根据您的需要相应地更改值。 This ideal for testing since you can see how much data is fed to the logstash. 这是测试的理想选择,因为您可以看到有多少数据输入到logstash。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM