Hello,
We're trying to index server details using the csv filter. The config file is as below. The weird problem we're facing is the index is created if I run logstash in foreground for testing.
COMMAND
/usr/share/logstash/vendor/jruby/bin/jruby /usr/share/logstash/lib/bootstrap/environment.rb logstash/runner.rb --path.settings /etc/logstash
But if I just start the server using systemctl start logstash
, then the index is not created.
CONFIG
input {
file {
path => "/infra/elk/unixtoelk_inv/aix_inv.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
type => unixinv
}
}
filter {
if [type] == "unixinv" {
csv {
separator => ","
columns => ["Date","Location","HostName","IP_Address","OS","OS_Version","Model","CPU_Type","Serial","Firmware","Kernel","Logical CPUs","Entitled CPUs","Vir_Min_CPU","Vir_Max_CPU","Phy_Min_CPU","Phy_Max_CPU","Capacity_Weight","Mode","Memory","Min_Mem","Max_Mem","Swap"]
}
date {
match => ["Date", "ddMMYYYYHHmmss"]
}
mutate {
remove_field => ["Date", "type", "path", "host", "message"]
}
}
}
output {
if [type] == "unixinv" {
elasticsearch {
index => "inv-unix-%{+dd-MM-YYYY}"
hosts => [ "10.1.1.1:9200" ]
}
}
}