misOrz

IT Tech & Life

How to use REST API input to Elasticsearch via logstash

1. Install logstash-filter-rest 2.  In your logstash config file add filter

Use Logstash-input-jdbc to synchronize sqlserver data to elasticsearch

1. Installation and download mssql-jdbc-6.2.2.jre8.jar bin/ plugin install logstash- input -jdbc go to Microsoft web site download mssql jdbc ㊣ , and then unzip gz file to /opt/logstash 2. Configuration input { stdin { } jdbc { jdbc_driver_library => " /opt/logstash/sqljdbc_6.2/enu/mssql-jdbc-6.2.2.jre8.jar " jdbc_driver_class => " com.microsoft.sqlserver.jdbc.SQLServerDriver " jdbc_connection_string => " jdbc:sqlserver://127.0.0.1:1433;DatabaseName=test " jdbc_user => " sa " jdbc_password => " 123456 " # schedule => m H D M Y # schedule => * 22 * * * // will execute at 22:00 every day schedule => " * * * * * " jdbc_paging_enabled => true jdbc_page_size => 1000 clean_run => false use_column_value => true ...

Logstash REST Filter

1. Installation You can use the built-in plugin tool of Logstash to install the filter: bin/logstash-plugin install logstash-filter-rest 2. Filter Configuration Add the following inside the filter section of your logstash configuration: filter { rest { request = > { url = > " http://example.com " # string (required, with field reference: "http://example.com?id=%{id}" or params, if defined) method = > " post " # string (optional, default = "get") headers = > { # hash (optional) " key1 " = > " value1 " " key2 " = > " value2 " } auth = > { user = > " AzureDiamond " password = > " hunter2 " } params = > { # hash (optional, available for method => "get" and "p...

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Report an error Under Ubuntu, running elasticsearch reports an error: Max virtual memory areas vm .max_map_count [ 65530 ] is too low , increase to at least [ 262144 ] solve Sudo vi /etc/sysctl.conf Add the following configuration Vm.max_map_count = 655360 Then execute the command Sudo sysctl -p Finally, you can start ES. Reference :  Ubuntu elasticsearch最大虛擬內存區域vm.max_map_count [65530]太低,增加到le

elastic "status": "yellow" | How to change status to green?

You can check UNASSIGNED first curl -s "http://localhost:9200/_cat/shards" | grep UNASSIGNED And then : curl -X PUT \   http://10.142.235.160:19200/_settings \   -H 'content-type: application/json' \   -d ' {  "number_of_replicas" : 0 } '