Skip to content

Commit

Permalink
fixed dbt transformation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelimoisili committed Jul 7, 2023
1 parent b4bb7da commit b569943
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion env.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CHT_PIPELINE_BRANCH_URL="https://github.com/medic/cht-pipeline.git#main"
# couchdb and logstash: required environment variables for 'gamma', 'prod' and 'local'
COUCHDB_USER=test
COUCHDB_PASSWORD=test
COUCHDB_DBS="medic medic_sentinel" # space sperated list of databases you want to sync e.g "medic medic_sentinel"
COUCHDB_DBS="couchdb couchdb_sentinel" # space sperated list of databases you want to sync e.g "medic medic_sentinel"
COUCHDB_HOST=couchdb
COUCHDB_PORT=5984
COUCHDB_SECURE=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
input {
couchdb_changes {
always_reconnect => true
db => "medic"
db => "couchdb"
host => "${COUCHDB_HOST}"
username => "${COUCHDB_USER}"
password => "${COUCHDB_PASSWORD}"
Expand All @@ -29,6 +29,6 @@ output {
format => "json"
http_method => "post"
ignorable_codes => 409
url => "http://${HTTP_ENDPOINT}/medic"
url => "http://${HTTP_ENDPOINT}/couchdb"
}
}
34 changes: 34 additions & 0 deletions logstash/pipeline/couchdb_sentinel.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

input {
couchdb_changes {
always_reconnect => true
db => "couchdb_sentinel"
host => "${COUCHDB_HOST}"
username => "${COUCHDB_USER}"
password => "${COUCHDB_PASSWORD}"
keep_id => true
keep_revision => true
secure => "${COUCHDB_SECURE}"
port => "${COUCHDB_PORT}"
sequence_path => "${COUCHDB_SEQ}"
}
}

filter {
json{
source => "message"
}
mutate {
add_field => { "_id" => "%{[doc][_id]}" }
add_field => { "_rev" => "%{[doc][_rev]}" }
}
}

output {
http {
format => "json"
http_method => "post"
ignorable_codes => 409
url => "http://${HTTP_ENDPOINT}/couchdb_sentinel"
}
}
2 changes: 1 addition & 1 deletion scripts/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "dotenv/config"
import path from "path";

export const COUCHDB_DBS = process.env.COUCHDB_DBS || "medic";
export const COUCHDB_DBS = process.env.COUCHDB_DBS || "couchdb";

export const LOGSTASH_PIPELINE_DIR = path.join(
__dirname,
Expand Down

0 comments on commit b569943

Please sign in to comment.