Filebeat Error while initializing input

I am trying to get data to send logs to kibana and when try to run filebeat -e -c filebeat.yml -d "publish" or filebeat -e I get error Exiting: Error interpreting the template of the input: template: text:3:22: executing "text" at <.paths>: range can't iterate over /mypath/log/myfile.log. How can I populate the file to create a dashboard? Is there anything else I need to format in the module directory

myfile logs snippet
"time",host,"number_a","number_b","error","msg","cc1"

for my logstash.yml for filebeat

  • module: logstash

    logs

    log:
    enabled: true

    Set custom paths for the log files. If left empty,

    Filebeat will choose the paths depending on your OS.

    var.paths: "/mypath/log/myfile.log "

    Slow logs

    slowlog:
    enabled: true

    Set custom paths for the log files. If left empty,

    Filebeat will choose the paths depending on your OS.

    #var.paths:

Welcome! When pasting configurations, please add triple-tildes (```) at the beginning and end to preserve formatting, otherwise it's hard to tell real errors apart from forum-post formatting :slight_smile: In this case it looks like you probably forgot the brackets around your paths parameter. try:

  var.paths: ["/mypath/log/myfile.log"]

If that doesn't fix it, can you repaste your filebeat.yml with the formatting preserved? Thanks!

Thanks i no longer receive that error however now I see this error.

filebeat -e
2019-07-10T09:19:08.175-0700 ERROR registrar/registrar.go:374 Writing of registry returned error: rename /var/lib/filebeat/registry/filebeat/data.json.new /var/lib/filebeat/registry/filebeat/data.json: no such file or directory. Continuing...
2019-07-10T09:19:08.264-0700 ERROR registrar/registrar.go:374 Writing of registry returned error: rename /var/lib/filebeat/registry/filebeat/data.json.new /var/lib/filebeat/registry/filebeat/data.json: no such file or directory. Continuing...
2019-07-10T09:19:08.372-0700 ERROR registrar/registrar.go:374 Writing of registry returned error: rename /var/lib/filebeat/registry/filebeat/data.json.new /var/lib/filebeat/registry/filebeat/data.json: no such file or directory. Continuing...
2019-07-10T09:19:08.607-0700 ERROR registrar/registrar.go:374 Writing of registry returned error: rename /var/lib/filebeat/registry/filebeat/data.json.new /var/lib/filebeat/registry/filebeat/data.json: no such file or directory. Continuing...
2019-07-10T09:19:08.898-0700 ERROR registrar/registrar.go:374 Writing of registry returned error: rename /var/lib/filebeat/registry/filebeat/data.json.new /var/lib/filebeat/registry/filebeat/data.json: no such file or directory. Continuing...
2019-07-10T09:19:08.952-0700 ERROR registrar/registrar.go:374 Writing of registry returned error: rename /var/lib/filebeat/registry/filebeat/data.json.new /var/lib/filebeat/registry/filebeat/data.json: no such file or directory. Continuing...
2019-07-10T09:19:09.050-0700 ERROR registrar/registrar.go:374 Writing of registry returned error: rename /var/lib/filebeat/registry/filebeat/data.json.new /var/lib/filebeat/registry/filebeat/data.json: no such file or directory. Continuing...
2019-07-10T09:19:09.343-0700 ERROR registrar/registrar.go:374 Writing of registry returned error: rename /var/lib/filebeat/registry/filebeat/data.json.new /var/lib/filebeat/registry/filebeat/data.json: no such file or directory. Continuing...

However when I run the below command
ls -lrth /var/lib/filebeat/registry/filebeat/data.json
-rw-------. 1 root root 14K Jul 10 09:19 /var/lib/filebeat/registry/filebeat/data.json

Let me know if I need to add anything to filebeat config

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