Hi guys,
I have a problem with the logstash output, it work fine when I didn't put index, but when I put my custom index name then it won't store in elasticsearch.
elasticsearch {
hosts => ["localhost:9200"]
index => "%{[@metadata][beat]}-%{index_day}}"
}
I tried the default one also not working
elasticsearch {
hosts => ["localhost:9200"]
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}}"
}
It only work with
elasticsearch {
hosts => ["localhost:9200"]
}
Logstash status:
[root@sla-bvt-elk-sjc01 conf.d]# systemctl status logstash -l
● logstash.service - logstash
Loaded: loaded (/etc/systemd/system/logstash.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2017-12-12 20:33:35 CST; 5min ago
Main PID: 14980 (java)
Memory: 482.7M
CGroup: /system.slice/logstash.service
└─14980 /bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -Xmx1g -Xms256m -Xss2048k -Djffi.boot.library.path=/usr/share/logstash/vendor/jruby/lib/jni -Xbootclasspath/a:/usr/share/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/usr/share/logstash/vendor/jruby -Djruby.lib=/usr/share/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main /usr/share/logstash/lib/bootstrap/environment.rb logstash/runner.rb --path.settings /etc/logstash
Dec 12 20:39:18 sla-bvt-elk-sjc01.sdad.sl.dst.ibm.com logstash[14980]: "index_day" => "2017.12.13",
Dec 12 20:39:18 sla-bvt-elk-sjc01.sdad.sl.dst.ibm.com logstash[14980]: "Timestamp" => "2017-12-13T10:39:13.741+08:00",
Dec 12 20:39:18 sla-bvt-elk-sjc01.sdad.sl.dst.ibm.com logstash[14980]: "Testcase_Name" => "default",
Dec 12 20:39:18 sla-bvt-elk-sjc01.sdad.sl.dst.ibm.com logstash[14980]: "@timestamp" => 2017-12-13T02:39:17.927Z,
Dec 12 20:39:18 sla-bvt-elk-sjc01.sdad.sl.dst.ibm.com logstash[14980]: "Policy_Name" => "policy_linux_entire_dir_perms",
Dec 12 20:39:18 sla-bvt-elk-sjc01.sdad.sl.dst.ibm.com logstash[14980]: "Log_Message" => "-----> Testing <default-REDHAT73--9-30-80-104>\n",
[root@sla-bvt-elk-sjc01 conf.d]# \