# Output jdbc data inserts

**URL:** <https://discuss.elastic.co/t/output-jdbc-data-inserts/310780>\
**Category:** Logstash\
**Created:** [July 27, 2022, 5:33pm UTC](https://discuss.elastic.co/t/output-jdbc-data-inserts/310780 "2022-07-27T17:33:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Calvete](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@Calvete](https://discuss.elastic.co/u/Calvete)\
**Post date:** [July 27, 2022, 5:33pm UTC](https://discuss.elastic.co/t/output-jdbc-data-inserts/310780/1 "2022-07-27T17:33:16Z")

</div>

Hello, my input is a file in s3 and I am making insections to an amazon aurora postgresq database.

The time is not good to insert more than 1 million records, it takes 1 hour and a half.

Help me

pipeline:  
batch:  
size: 1000  
delay: 50  
pipeline.workers: 2  
pipeline.id: persisted-queue-pipeline  
pipeline.ordered: false  
queue.type: persisted  
queue.max\_bytes: 2000mb  
queue.drain: true

input {  
s3 {  
bucket =\> "bucket"  
prefix =\> "c5/"   
additional\_settings =\> {  
force\_path\_style =\> true  
follow\_redirects =\> false  
}  
watch\_for\_new\_files =\> false  
delete =\> false  
tags =\> ["load\_file"]  
}   
}  
filter {   
csv {   
separator =\> ";"  
columns =\> [""]  
skip\_header =\> "true"  
}

output {

```
            jdbc {
                  driver_jar_path => "/usr/share/logstash/lib/jars/postgresql-42.3.1.jar"
                  driver_class => "org.postgresql.Driver"
                  connection_string => "jdbc:postgresql:/.rds.amazonaws.com:5432-aurora-database"
                  username => ""
                  password => ""
                 #max_pool_size => "20"
                  #flush_size => "4000"
                  statement => ["INSERT INTO public.table(
                                campo1,campo2,
                                campo4, campo, campo3, 
                                campo5,campo6, 
                                campo7,campo8,checksum,campo9) 
                                
                                VALUES (CAST(? AS UUID),CAST(? AS NUMERIC),?, ?, ?, ?, ?, ?,?,?,?)",
                                "uuid","[target_parametric][0][campo]","campo1","campo2","campo3","campo4","campo5","campo6","campo7","checksum","campo8"]
            }

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 24, 2022, 5:34pm UTC](https://discuss.elastic.co/t/output-jdbc-data-inserts/310780/2 "2022-08-24T17:34:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
