OK. Understood your point.
Facing new issue now. With following logstash configuration, file lookup2.csv is not created under path C:/elkstack/elasticsearch-6.5.1/logs/.
Logstash Configuraiton:
input{ file{ path => "C:/elkstack/elasticsearch-6.5.1/logs/lookup.csv"
start_position => "beginning"
sincedb_path => "null" }
}
filter{ mutate { gsub => [ "message", ",", ";", "message", "^([^;]*);", "\1," ] }}
output { file { path => "C:/elkstack/elasticsearch-6.5.1/logs/lookup2.csv"
codec => plain { format => "%{message}" }
}
stdout { codec => rubydebug }
}
Logs in Trace Mode, and I don't why it trying to read another csv file (csv1.csv), it should read lookup.csv only
[2019-02-07T14:55:13,040][TRACE][logstash.inputs.file ] Registering file input {:path=>["C:/elkstack/elasticsearch-6.5.1/logs/lookup.csv"]}
[2019-02-07T14:55:13,199][INFO ][logstash.pipeline ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0xb1445b5 run>"}
[2019-02-07T14:55:13,257][TRACE][logstash.agent ] Converge results {:success=>true, :failed_actions=>[], :successful_actions=>["id: main, action_type: LogStash::PipelineAction::Create"]}
[2019-02-07T14:55:13,358][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2019-02-07T14:55:13,412][INFO ][filewatch.observingtail ] START, creating Discoverer, Watch with file and sincedb collections
[2019-02-07T14:55:13,422][DEBUG][logstash.agent ] Starting puma
[2019-02-07T14:55:13,454][DEBUG][logstash.agent ] Trying to start WebServer {:port=>9600}
[2019-02-07T14:55:13,519][TRACE][filewatch.sincedbcollection] open: reading from null
[2019-02-07T14:55:13,581][DEBUG][logstash.api.service ] [api-service] start
[2019-02-07T14:55:13,591][TRACE][filewatch.sincedbcollection] open: importing ... 'unknown 0 0' => '4326 1549457898.591 C:/elkstack/elasticsearch-6.5.1/logs/csv1.csv'
[2019-02-07T14:55:13,608][TRACE][filewatch.sincedbcollection] open: setting #<struct FileWatch::InodeStruct inode="unknown", maj=0, min=0> to #<FileWatch::SincedbValue:0x9e31798 @last_changed_at=1549457898.591, @path_in_sincedb="C:/elkstack/elasticsearch-6.5.1/logs/csv1.csv", @watched_file=nil, @position=4326>
[2019-02-07T14:55:13,622][TRACE][filewatch.sincedbcollection] open: importing ... '4001839134-462055-1638400 0 0' => '4026 1549521929.361 C:/elkstack/elasticsearch-6.5.1/logs/lookup.csv'
[2019-02-07T14:55:13,626][TRACE][filewatch.sincedbcollection] open: setting #<struct FileWatch::InodeStruct inode="4001839134-462055-1638400", maj=0, min=0> to #<FileWatch::SincedbValue:0x60b41a89 @last_changed_at=1549521929.361, @path_in_sincedb="C:/elkstack/elasticsearch-6.5.1/logs/lookup.csv", @watched_file=nil, @position=4026>
[2019-02-07T14:55:13,637][TRACE][filewatch.sincedbcollection] open: count of keys read: 2
[2019-02-07T14:55:13,761][TRACE][filewatch.discoverer ] discover_files {"count"=>1}
[2019-02-07T14:55:13,949][TRACE][filewatch.discoverer ] discover_files handling: {"new discovery"=>true, "watched_file details"=>"<FileWatch::WatchedFile: @filename='lookup.csv', @state='watched', @recent_states='[:watched]', @bytes_read='0', @bytes_unread='0', current_size='4026', last_stat_size='4026', file_open?='false', @initial=true, @sincedb_key='4001839134-462055-1638400 0 0'>"}
[2019-02-07T14:55:13,962][TRACE][filewatch.sincedbcollection] associate: finding {"inode"=>"4001839134-462055-1638400", "path"=>"C:/elkstack/elasticsearch-6.5.1/logs/lookup.csv"}
[2019-02-07T14:55:13,981][TRACE][filewatch.sincedbcollection] associate: found sincedb record {"filename"=>"lookup.csv", "sincedb key"=>#<struct FileWatch::InodeStruct inode="4001839134-462055-1638400", maj=0, min=0>, "sincedb_value"=>#<FileWatch::SincedbValue:0x60b41a89 @last_changed_at=1549521929.361, @path_in_sincedb="C:/elkstack/elasticsearch-6.5.1/logs/lookup.csv", @watched_file=nil, @position=4026>}
[2019-02-07T14:55:14,047][TRACE][filewatch.sincedbcollection] handle_association fully read, ignoring..... {"watched file"=>"<FileWatch::WatchedFile: @filename='lookup.csv', @state='ignored', @recent_states='[:watched, :watched]', @bytes_read='4026', @bytes_unread='0', current_size='4026', last_stat_size='4026', file_open?='false', @initial=false, @sincedb_key='4001839134-462055-1638400 0 0'>", "sincedb value"=>#<FileWatch::SincedbValue:0x60b41a89 @last_changed_at=1549522514.023, @path_in_sincedb="C:/elkstack/elasticsearch-6.5.1/logs/lookup.csv", @watched_file="<FileWatch::WatchedFile: @filename='lookup.csv', @state='ignored', @sincedb_key='4001839134-462055-1638400 0 0, size=4026>", @position=4026>}
[2019-02-07T14:55:14,060][TRACE][filewatch.sincedbcollection] associate: inode and path matched
[2019-02-07T14:55:14,141][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}