Hi I have multiple log file created based on user. i want to take input all user log file and create index for that.
For Ex
Input section
nput {
file {
add_field => [ "host", "my-dev-host" ]
path => "D:\JHipster_Demo\adminlogFile.%d{yyyy-MM-dd}.log"
codec => "plain"
}
file {
add_field => [ "host", "my-dev-host" ]
path => "D:\JHipster_Demo\unknownlogFile.%d{yyyy-MM-dd}.log"
codec => "plain"
}
Filter section
filter {
grok {
match => [ "path", "D:/JHipster_Demo/(?[^]+)/" ]
}
date {
match => [ "timestamp" , "YYYY/MM/DD:HH:mm:ss Z" ]
}
}
output section
utput {
elasticsearch{
index => "global2-%{project}-%{+YYYY.MM.dd}"
hosts => [ "localhost:9200" ]
}
stdout { codec => rubydebug }
}
Getting below error
[2017-08-02T18:51:57,754][ERROR][logstash.agent ] Pipeline aborted due
to error {:exception=>#<RegexpError: premature end of char-class: /D:/JHipster
_Demo/(?[^]+)//m>, :backtrace=>["org/jruby/RubyRegexp.java:1434:in initialize'", "D:/logstash-5.5.0/vendor/bundle/jruby/1.9/gems/jls-grok-0.11.4/li b/grok-pure.rb:127:in
compile'", "D:/logstash-5.5.0/vendor/bundle/jruby/1.9/gem
s/logstash-filter-grok-3.4.2/lib/logstash/filters/grok.rb:286:in register'", "o rg/jruby/RubyArray.java:1613:in
each'", "D:/logstash-5.5.0/vendor/bundle/jruby/
1.9/gems/logstash-filter-grok-3.4.2/lib/logstash/filters/grok.rb:280:in registe r'", "org/jruby/RubyHash.java:1342:in
each'", "D:/logstash-5.5.0/vendor/bundle/
jruby/1.9/gems/logstash-filter-grok-3.4.2/lib/logstash/filters/grok.rb:275:in r egister'", "D:/logstash-5.5.0/logstash-core/lib/logstash/pipeline.rb:281:in
reg
ister_plugin'", "D:/logstash-5.5.0/logstash-core/lib/logstash/pipeline.rb:292:in
register_plugins'", "org/jruby/RubyArray.java:1613:in
each'", "D:/logstash-5.
5.0/logstash-core/lib/logstash/pipeline.rb:292:in register_plugins'", "D:/logst ash-5.5.0/logstash-core/lib/logstash/pipeline.rb:302:in
start_workers'", "D:/lo
gstash-5.5.0/logstash-core/lib/logstash/pipeline.rb:226:in run'", "D:/logstash- 5.5.0/logstash-core/lib/logstash/agent.rb:398:in
start_pipeline'"]}
[2017-08-02T18:51:57,988][INFO ][logstash.agent ] Successfully started