Logstash API error

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:

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:

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.

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