# Logstash API error

**URL:** <https://discuss.elastic.co/t/logstash-api-error/198835>\
**Category:** Elasticsearch\
**Created:** [September 10, 2019, 7:22am UTC](https://discuss.elastic.co/t/logstash-api-error/198835 "2019-09-10T07:22:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![katara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/katara/32/60143_2.png) [@katara](https://discuss.elastic.co/u/katara)\
**Post date:** [September 10, 2019, 7:22am UTC](https://discuss.elastic.co/t/logstash-api-error/198835/1 "2019-09-10T07:22:04Z")

</div>

Im trying to create an API connection in Logstash and push the data to elasticsearch. Both Elasticsearch and Logstash versions are 7.1.0. Below id the logstash file:

```auto
input {
          http_poller {
            urls => {
              test2 => {
                method => get
        user => "readonly"
            password => "mypass@123"
                url => "https://nfr.saas.appdynamics.com/controller/rest/applications?output=JSON"
                headers => {
                  Accept => "application/json"
                }
             }
            }
            request_timeout => 60
            # Supports "cron", "every", "at" and "in" schedules by rufus scheduler
            schedule => { cron => "* * * * * UTC"}
            codec => "json"
            # A hash of request metadata info (timing, response headers, etc.) will be sent here
            metadata_target => "http_poller_metadata"
          }
        }

        output {
          elasticsearch { hosts => ["localhost:9200"]
           index => "dataapi" }
          stdout { codec => rubydebug }
        }

```

I am receiving an error:

```auto
27)
        at org.jruby.ir.Compiler$1.load(Compiler.java:94)
        at org.jruby.Ruby.runScript(Ruby.java:856)
        at org.jruby.Ruby.runNormally(Ruby.java:779)
        at org.jruby.Ruby.runNormally(Ruby.java:797)
        at org.jruby.Ruby.runFromMain(Ruby.java:609)
        at org.logstash.Logstash.run(Logstash.java:102)
        at org.logstash.Logstash.main(Logstash.java:45)

    2019-09-10 06:12:58,027 main ERROR Null object returned for RollingFile in Appenders.
    2019-09-10 06:12:58,036 main ERROR Null object returned for RollingFile in Appenders.
    2019-09-10 06:12:58,040 main ERROR Null object returned for RollingFile in Appenders.
    2019-09-10 06:12:58,041 main ERROR Null object returned for RollingFile in Appenders.
    2019-09-10 06:12:58,042 main ERROR Unable to locate appender "plain_rolling" forlogger config "root"
    2019-09-10 06:12:58,045 main ERROR Unable to locate appender "plain_rolling_slowlog" for logger config "slowlog"
    [2019-09-10T06:12:58,446][WARN][logstash.config.source.multilocal] Ignoring the'pipelines.yml' file because modules or command line options are specified
    [2019-09-10T06:12:58,480][FATAL][logstash.runner] An unexpected error
    occurred! {:error=>java.nio.file.AccessDeniedException: D:\logstash-7.1.0\logsta
    sh-7.1.0\data\.lock, :backtrace=>["sun.nio.fs.WindowsException.translateToIOExce
    ption(sun/nio/fs/WindowsException.java:83)", "sun.nio.fs.WindowsException.rethro
    wAsIOException(sun/nio/fs/WindowsException.java:97)", "sun.nio.fs.WindowsException

```

Im new to APIs, and I'm not sure how to simply fetch the output from the URL. Could you help me on getting this corrected? The URL works when i hit it on my browser.

---

<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:** [October 8, 2019, 7:22am UTC](https://discuss.elastic.co/t/logstash-api-error/198835/2 "2019-10-08T07:22:36Z")

</div>

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