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