Logstash file input plugin

Hi,
I am trying to use logstash file input plugin. I want to pick files from multiple locations and send them to different indices. Here is my config

nput {
    file {
            type => "TomEE-logs-passport"
            path => "/etc/logstash/logs/TomEE.2023-04-19.log"
    }
    file {
            type => "TomEE-access-passport"
            path => "/etc/logstash/logs/localhost_access_log..2023-04-20.txt"
    }
}
output {
    if [type] == "TomEE-logs-passport" {
       elasticsearch {
                         hosts => "http://ip:9200"
                         user => "elastic"
                         password => "pwd"
                         index => "%{type}-%{+YYYY.MM.dd}"
       }
    }
    if [type] == "TomEE-access-passport" {
        elasticsearch {
                         hosts => "http://IP:9200"
                         user => "elastic"
                         password => "pwd"
                         index => "%{type}-%{+YYYY.MM.dd}"
        }
     }
}

After this is do config test, it shows ok. Then i restart logstash. There are no errors but there is no data also in elastic stack. Am i missing something. I have installed the file input plugin too

Hi @Neelam_Zanvar,

Can you change the logging level to debug and see if there is any additional information coming through in the logs? There is details in the docs to help.

And again...Your file has been read. The line tracking is recorded in the sincedb database file. The sincedb can be in the runtime, if you set to null.
Also would recommend to you to read about File Input Configuration Options.

input {
    file {
            type => "TomEE-logs-passport"
            path => "/etc/logstash/logs/TomEE.2023-04-19.log"
            start_position => "beginning" # default is end
            sincedb_path => "/dev/null"
            sincedb_clean_after => "1 hour" # this is optionally
    }

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