# Logstash does not execute config file

**URL:** <https://discuss.elastic.co/t/logstash-does-not-execute-config-file/301594>\
**Category:** Logstash\
**Created:** [April 5, 2022, 6:46am UTC](https://discuss.elastic.co/t/logstash-does-not-execute-config-file/301594 "2022-04-05T06:46:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niya](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@Niya](https://discuss.elastic.co/u/Niya)\
**Post date:** [April 5, 2022, 6:46am UTC](https://discuss.elastic.co/t/logstash-does-not-execute-config-file/301594/1 "2022-04-05T06:46:55Z")

</div>

I want some data in a postgresql database to be indexed to an Elasticsearch index. To do so I decided to use Logstash. I installed Logstash and JDBC.

I perform the following config:

```auto
    jdbc {
        jdbc_connection_string => "jdbc:postgresql://localhost:5432/product_data"
        jdbc_user => "postgres"
        jdbc_password => "<my_password>"
        jdbc_driver_class => "org.postgresql.Driver"
        schedule => "* * * * *" # cronjob schedule format (see "Helpful Links")
        statement => "SELECT * FROM public.vendor_product" # the PG command for retrieving the documents IMPORTANT: no semicolon!
        jdbc_paging_enabled => "true"
        jdbc_page_size => "300"
    }
}

output {
    # used to output the values in the terminal (DEBUGGING)
    # once everything is working, comment out this line
    stdout { codec => "json" }
    # used to output the values into elasticsearch
    elasticsearch {
        hosts => ["localhost:9200"]
        index => "vendorproduct"
        document_id => "document_%id"
        doc_as_upsert => true # upserts documents (e.g. if the document does not exist, creates a new record)
    }
}

```

As a test I sheduled this every minute. To run my test I did: `logstash.bat -f logstash_postgre_ES.conf --debug`

On my console I get:

```auto
...
[2022-04-04T16:10:07,065][DEBUG][logstash.agent] Starting puma
[2022-04-04T16:10:07,081][DEBUG][logstash.agent] Trying to start WebServer {:port=>9600}
[2022-04-04T16:10:07,190][DEBUG][logstash.api.service] [api-service] start
[2022-04-04T16:10:07,834][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
C:/Users/Admin/Desktop/Elastic_search/logstash-6.8.23/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/cronline.rb:77: warning: constant ::Fixnum is deprecated
[2022-04-04T16:10:09,577][DEBUG][logstash.instrument.periodicpoller.cgroup] One or more required cgroup files or directories not found: /proc/self/cgroup, /sys/fs/cgroup/cpuacct, /sys/fs/cgroup/cpu
[2022-04-04T16:10:09,948][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=>"ParNew"}
[2022-04-04T16:10:09,951][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=>"ConcurrentMarkSweep"}
[2022-04-04T16:10:11,717][DEBUG][logstash.pipeline] Pushing flush onto pipeline {:pipeline_id=>"main", :thread=>"#<Thread:0xaf6cee2 sleep>"}
[2022-04-04T16:10:14,595][DEBUG][logstash.instrument.periodicpoller.cgroup] One or more required cgroup files or directories not found: /proc/self/cgroup, /sys/fs/cgroup/cpuacct, /sys/fs/cgroup/cpu
[2022-04-04T16:10:14,960][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=>"ParNew"}
[2022-04-04T16:10:14,961][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=>"ConcurrentMarkSweep"}
[2022-04-04T16:10:16,742][DEBUG][logstash.pipeline] Pushing flush onto pipeline {:pipeline_id=>"main", :thread=>"#<Thread:0xaf6cee2 sleep>"}
[2022-04-04T16:10:19,604][DEBUG][logstash.instrument.periodicpoller.cgroup] One or more required cgroup files or directories not found: /proc/self/cgroup, /sys/fs/cgroup/cpuacct, /sys/fs/cgroup/cpu

```

The last part gets printed every 2 seconds or so, for me it seems like its waiting to start though I let this run several minutes and it kept printing the same lines. In Kibana I check if my index got created but that wasn't the case.

The logstash-plain.log gives the same output as the console. Why is there no index created and filled with the postgresqldata?

---

<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:** [May 3, 2022, 6:47am UTC](https://discuss.elastic.co/t/logstash-does-not-execute-config-file/301594/2 "2022-05-03T06:47:48Z")

</div>

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