Blob


1 This is more of a note to the future myself rather than a proper post.
2 However...
4 I've got an error trying to synchronize elasticsearch and postgresql
5 using logstash. My configurations was along the lines of
7 ```logstash
8 input {
9 jdbc {
10 jdbc_connection_string => "jdbc:postgresql://192.168.2.156:5432/chiaki"
11 jdbc_user => "chiaki"
12 jdbc_driver_library => "/path/to/postgresql-42.2.12.jre7.jar"
13 jdbc_driver_class => "org.postgresql.Driver"
14 jdbc_validate_connection => true
15 statement => "select * from foo"
16 }
17 }
19 output {
20 elasticsearch {
21 hosts => ["http://localhost:9200"]
22 index => "foo"
23 document_id => "%{the_pk}"
24 doc_as_upsert => true
25 }
26 }
27 ```
29 But it error'd with something like "role _logstash does not exists."
31 I haven't really tracked down the issued, but found a workaround:
32 specify the user *also* in the connection string.
34 It's quite strange, since the `jdbc_user` params is required.
36 P.S. the error was about a missing `_logstash` role because on OpenBSD
37 that user is created for logstash. This was a hint that `jdbc_user`
38 wasn't respected.