How to configure multiple log files with different name in one logstash.conf instance.
I am using below configuration , with single files it is working fine ,but multiple file with different index name doesn't work.
FileBeat.yaml:
filebeat.inputs:
filebeat.prospectors:
type: log
Change to true to enable this input configuration.
enabled: true
Paths that should be crawled and fetched. Glob based paths.
paths:
- /var/log/*.log
c:\logfile* #- c:\programdata\elasticsearch\logs*
LogStash.conf:
input {
beats {
port => 5044
}
}
filter {
grok {
match => ["message","(?(([0-9]+)-)+ ([0-9]+:)+.*)|%{WORD:LOGLEVEL}|%{WORD:LOGSOURCE}|%{GREEDYDATA:LOGMESSAGE}"]
}
}
filebeat.inputs:
filebeat.prospectors:
- type: log
# Change to true to enable this input configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
# - /var/log/*.log
- c:\logfile\*
#- c:\programdata\elasticsearch\logs\*
# Optional additional fields. These fields can be freely picked
# to add additional information to the crawled log files for filtering
fields:
level: debug
review: 1
forum: true
type: "logs1"
### Multiline options
# Multiline can be used for log messages spanning multiple lines. This is common
# for Java Stack Traces or C-Line Continuation
# The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
# Defines if the pattern set under pattern should be negated or not. Default is false.
multiline.negate: true
maybe you can try playing with metadata and specifying index like index => "teslog-%{[@metadata][source]}-%{+YYYY.MM.dd}"
or index => "teslog-%{[@metadata][_source]}-%{+YYYY.MM.dd}"
I haven't tried this so please let me know if this works
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.