Process ignoring parts of logstash.yml?


#1

Hoping someone can explain this, was unable to find relative posts. Running into an issue where my logstash.yml settings are only partially being read when I start my logstash service.

Hostname is read, but nearly all other settings are ignored and assigned default values. The defaults are causing irregular outputs and broken health checks to an ES node at localhost, which does not exist (I have it bound to the local IP instead, this is specified in logstash.yml and my logstash/conf.d config).

Config and outputs are as follows:

Running logstash:

/usr/share/logstash/bin/logstash --verbose --debug --path.settings /etc/logstash --path.config /etc/logstash/conf.d

/etc/logstash/logstash.yml:

# Settings file in YAML
#
# Settings can be specified either in hierarchical form, e.g.:
#
#   pipeline:
#     batch:
#       size: 125
#       delay: 5
#
# Or as flat keys:
#
#   pipeline.batch.size: 125
#   pipeline.batch.delay: 5
#
# ------------  Node identity ------------
#
# Use a descriptive name for the node:
#
 node.name: logstash-lab
#
# If omitted the node name will default to the machine's host name
#
# ------------ Data path ------------------
#
# Which directory should be used by logstash and its plugins
# for any persistent needs. Defaults to LOGSTASHHOME/data
#
path.data: /var/lib/logstash
#
# ------------ Pipeline Settings --------------
#
# Set the number of workers that will, in parallel, execute the filters+outputs
# stage of the pipeline.
#
# This defaults to the number of the host's CPU cores.
#
# pipeline.workers: 2
#
# How many workers should be used per output plugin instance
#
# pipeline.output.workers: 1
#
# How many events to retrieve from inputs before sending to filters+workers
#
# pipeline.batch.size: 125
#
# How long to wait before dispatching an undersized batch to filters+workers
# Value is in milliseconds.
#
# pipeline.batch.delay: 5
#
# Force Logstash to exit during shutdown even if there are still inflight
# events in memory. By default, logstash will refuse to quit until all
# received events have been pushed to the outputs.
#
# WARNING: enabling this can lead to data loss during shutdown
#
# pipeline.unsafeshutdown: false
#
# ------------ Pipeline Configuration Settings --------------
#
# Where to fetch the pipeline configuration for the main pipeline
#
path.config: /etc/logstash/conf.d
#
# Pipeline configuration string for the main pipeline
#
# config.string:
#
# At startup, test if the configuration is valid and exit (dry run)
#
# config.testandexit: false
#
# Periodically check if the configuration has changed and reload the pipeline
# This can also be triggered manually through the SIGHUP signal
#
# config.reload.automatic: false
#
# How often to check if the pipeline configuration has changed (in seconds)
#
# config.reload.interval: 3
#
# Show fully compiled configuration as debug log message
# NOTE: --log.level must be 'debug'
#
# config.debug: false
#
# ------------ Module Settings ---------------
# Define modules here.  Modules definitions must be defined as an array.
# The simple way to see this is to prepend each `name` with a `-`, and keep
# all associated variables under the `name` they are associated with, and
# above the next, like this:
#
# modules:
#   - name: MODULENAME
#     var.PLUGINTYPE1.PLUGINNAME1.KEY1: VALUE
#     var.PLUGINTYPE1.PLUGINNAME1.KEY2: VALUE
#     var.PLUGINTYPE2.PLUGINNAME1.KEY1: VALUE
#     var.PLUGINTYPE3.PLUGINNAME3.KEY1: VALUE
#
# Module variable names must be in the format of
#
# var.PLUGINTYPE.PLUGINNAME.KEY
#
# modules:
#
# ------------ Queuing Settings --------------
#
# Internal queuing model, "memory" for legacy in-memory based queuing and
# "persisted" for disk-based acked queueing. Defaults is memory
#
# queue.type: memory
#
# If using queue.type: persisted, the directory path where the data files will be stored.
# Default is path.data/queue
#
# path.queue:
#
# If using queue.type: persisted, the page data files size. The queue data consists of
# append-only data files separated into pages. Default is 250mb
#
# queue.pagecapacity: 250mb
#
# If using queue.type: persisted, the maximum number of unread events in the queue.
# Default is 0 (unlimited)
#
# queue.maxevents: 0
#
# If using queue.type: persisted, the total capacity of the queue in number of bytes.
# If you would like more unacked events to be buffered in Logstash, you can increase the
# capacity using this setting. Please make sure your disk drive has capacity greater than
# the size specified here. If both maxbytes and maxevents are specified, Logstash will pick
# whichever criteria is reached first
# Default is 1024mb or 1gb
#
# queue.maxbytes: 1024mb
#
# If using queue.type: persisted, the maximum number of acked events before forcing a checkpoint
# Default is 1024, 0 for unlimited
#
# queue.checkpoint.acks: 1024
#
# If using queue.type: persisted, the maximum number of written events before forcing a checkpoint
# Default is 1024, 0 for unlimited
#
# queue.checkpoint.writes: 1024
#
# If using queue.type: persisted, the interval in milliseconds when a checkpoint is forced on the head page
# Default is 1000, 0 for no periodic checkpoint.
#
# queue.checkpoint.interval: 1000
#
# ------------ Dead-Letter Queue Settings --------------
# Flag to turn on dead-letter queue.
#
# deadletterqueue.enable: false

# If using deadletterqueue.enable: true, the maximum size of each dead letter queue. Entries
# will be dropped if they would increase the size of the dead letter queue beyond this setting.
# Deafault is 1024mb
# deadletterqueue.maxbytes: 1024mb

# If using deadletterqueue.enable: true, the directory path where the data files will be stored.
# Default is path.data/deadletterqueue
#
# path.deadletterqueue:
#
# ------------ Metrics Settings --------------
#
# Bind address for the metrics REST endpoint
#
 http.host: "192.168.3.22"
#
# Bind port for the metrics REST endpoint, this option also accept a range
# (9600-9700) and logstash will pick up the first available ports.
#
# http.port: 9600-9700
#
# ------------ Debugging Settings --------------
#
# Options for log.level:
#   * fatal
#   * error
#   * warn
#   * info (default)
#   * debug
#   * trace
#
# log.level: info
path.logs: /var/log/logstash
#
# ------------ Other Settings --------------
#
# Where to find custom plugins
# path.plugins: []
 xpack.monitoring.elasticsearch.url: "http://192.168.3.22:9200"
 xpack.monitoring.elasticsearch.username: "customusername"
 xpack.monitoring.elasticsearch.password: "password"

/etc/logstash/conf.d/logstash-exampleconf.conf


input { stdin { } }
output {
  elasticsearch {
                  hosts => ["192.168.3.22:9200"]
                  user => ["customusername"]
                  password => ["password"]
                }
  stdout { codec => rubydebug }
}

Any help/insight would be greatly appreciated, thank you!


#2

adding logging output:

Logging output

[2017-08-21T19:31:46,912][DEBUG][logstash.runner          ] -------- Logstash Settings (* means modified) ---------
[2017-08-21T19:31:46,912][DEBUG][logstash.runner          ] *node.name: "logstash-lab" (default: "0.0.0.0")
[2017-08-21T19:31:46,912][DEBUG][logstash.runner          ] path.data: "/usr/share/logstash/data"
[2017-08-21T19:31:46,912][DEBUG][logstash.runner          ] modules.cli: []
[2017-08-21T19:31:46,912][DEBUG][logstash.runner          ] modules: []
[2017-08-21T19:31:46,912][DEBUG][logstash.runner          ] config.test_and_exit: false
[2017-08-21T19:31:46,912][DEBUG][logstash.runner          ] config.reload.automatic: false
[2017-08-21T19:31:46,912][DEBUG][logstash.runner          ] config.reload.interval: 3
[2017-08-21T19:31:46,913][DEBUG][logstash.runner          ] metric.collect: true
[2017-08-21T19:31:46,913][DEBUG][logstash.runner          ] pipeline.id: "main"
[2017-08-21T19:31:46,913][DEBUG][logstash.runner          ] pipeline.system: false
[2017-08-21T19:31:46,913][DEBUG][logstash.runner          ] pipeline.workers: 4
[2017-08-21T19:31:46,913][DEBUG][logstash.runner          ] pipeline.output.workers: 1
[2017-08-21T19:31:46,913][DEBUG][logstash.runner          ] pipeline.batch.size: 125
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] pipeline.batch.delay: 5
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] pipeline.unsafe_shutdown: false
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] path.plugins: []
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] config.debug: false
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] *log.level: "debug" (default: "info")
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] version: false
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] help: false
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] log.format: "plain"
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] http.host: "127.0.0.1"
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] http.port: 9600..9700
[2017-08-21T19:31:46,914][DEBUG][logstash.runner          ] http.environment: "production"
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] queue.type: "memory"
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] queue.drain: false
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] queue.page_capacity: 262144000
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] queue.max_bytes: 1073741824
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] queue.max_events: 0
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] queue.checkpoint.acks: 1024
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] queue.checkpoint.writes: 1024
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] queue.checkpoint.interval: 1000
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] dead_letter_queue.enable: false
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] dead_letter_queue.max_bytes: 1073741824
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] slowlog.threshold.warn: -1
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] slowlog.threshold.info: -1
[2017-08-21T19:31:46,915][DEBUG][logstash.runner          ] slowlog.threshold.debug: -1
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] slowlog.threshold.trace: -1
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] path.queue: "/usr/share/logstash/data/queue"
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] path.dead_letter_queue: "/usr/share/logstash/data/dead_letter_queue"
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] *path.settings: "/etc/logstash" (default: "/usr/share/logstash/config")
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] path.logs: "/usr/share/logstash/logs"
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] xpack.monitoring.enabled: true
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] xpack.monitoring.elasticsearch.url: ["http://localhost:9200"]
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] xpack.monitoring.collection.interval: 10000000000
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] xpack.monitoring.collection.timeout_interval: 600000000000
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] xpack.monitoring.elasticsearch.username: "logstash_system"
[2017-08-21T19:31:46,916][DEBUG][logstash.runner          ] xpack.monitoring.elasticsearch.password: "changeme"
[2017-08-21T19:31:46,917][DEBUG][logstash.runner          ] xpack.monitoring.elasticsearch.ssl.verification_mode: "certificate"
[2017-08-21T19:31:46,917][DEBUG][logstash.runner          ] xpack.monitoring.elasticsearch.sniffing: false
[2017-08-21T19:31:46,917][DEBUG][logstash.runner          ] node.uuid: ""

(Christian Dahlqvist) #3

Yaml is sensitive to indentation, so your config file does not look correct. Remove the leading space from the node.name, http.host and xpack.* lines and try again.


#4

Perfect, working fine now. Thank you!


(system) #5

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