Commit Diff


commit - e6ea5eacc02e237c9c82d41b74d76be4e7121c52
commit + 700fe2b12d417dce79234183b3d8a57ad9b6343e
blob - /dev/null
blob + f872610ac2409587e04b7e0f422801ba9f38ec44 (mode 644)
--- /dev/null
+++ resources/posts/logstash-jdbc-role-does-not-exists.md
@@ -0,0 +1,38 @@
+This is more of a note to the future myself rather than a proper post.
+However...
+
+I've got an error trying to synchronize elasticsearch and postgresql
+using logstash.  My configurations was along the lines of
+
+```yml
+input {
+    jdbc {
+        jdbc_connection_string => "jdbc:postgresql://192.168.2.156:5432/chiaki"
+        jdbc_user => "chiaki"
+        jdbc_driver_library => "/path/to/postgresql-42.2.12.jre7.jar"
+        jdbc_driver_class => "org.postgresql.Driver"
+        jdbc_validate_connection => true
+        statement => "select * from foo"
+    }
+}
+
+output {
+    elasticsearch {
+        hosts => ["http://localhost:9200"]
+        index => "foo"
+        document_id => "%{the_pk}"
+        doc_as_upsert => true
+    }
+}
+```
+
+But it error'd with something like "role _logstash does not exists."
+
+I haven't really tracked down the issued, but found a workaround:
+specify the user *also* in the connection string.
+
+It's quite strange, since the `jdbc_user` params is required.
+
+P.S. the error was about a missing `_logstash` role because on OpenBSD
+that user is created for logstash.  This was a hint that `jdbc_user`
+wasn't respected.
blob - 2427a0497c86ab1b9f605664a495a58f278b1e95
blob + 6e74bc5baaf1c9c7410ed0967f9779beeec36a7b
--- src/blog/posts.clj
+++ src/blog/posts.clj
@@ -1,3 +1,9 @@
+(add-post! {:title "Logstash + jdbc = role does not exists"
+            :slug "logstash-jdbc-role-does-not-exists"
+            :date "2020/05/10"
+            :tags #{:logstash :postgresql}
+            :short "TL;DR use the connection string properly"})
+
 (add-post! {:title "Finite State Machine in Godot"
             :slug "finite-automata-godot"
             :date "2020/04/29"