I did this
input {
file {
path => "/usr/share/src-input/x_tran.csv"
start_position => beginning
sincedb_path => "/dev/null"
codec => multiline {
codec => multiline {
pattern => "^Spalanzani"
what => "previous"
negate => true
auto_flush_interval => 5
max_lines => 200000000
}
}
}
}
filter {
}
output {
exec {
command => "java -Xms256m -Xmx2048m -cp /var/script:/var/script/lib/* com.csvParser /usr/share/src-input/x_tran.csv /usr/share/src-output/output.csv"
}
}
and it didn't trigger what's in the exec section at all! and it outputted the whole file to the log terminal several times!
Here's what's on the terminal @Badger :
The file I'm reading is quiet huge, 175 MB, and it outputs the whole content and then stops -> triggers the exec and then it re-loads the file again and so on!
109,-0.5782514288558133,0.050161287579731366,0.5445701020894942,-0.27990449217000146,-0.04159897836869265",
"tags" => [
[0] "multiline",
[1] "multiline_codec_max_lines_reached"
],
"@timestamp" => 2019-08-27T00:36:42.643Z,
"path" => "/usr/share/src-input/x_tran.csv",
"@version" => "1"
}
{
"host" => "c630ebf27529",
"message" => "74325,-0.82746815590408,0.6255582343669068,-0.5666050527906277,0.677479073905684,-0.4558699395151055,-1.2371385120679403,-0.40550146017102334,-0.92063 , .... ..... .... "
[0] "multiline",
[1] "multiline_codec_max_bytes_reached"
}
[2019-08-27T00:13:50,199][INFO ][logstash.outputs.exec ]
[2019-08-27T00:13:50,400][INFO ][logstash.outputs.exec ]
[2019-08-27T00:13:50,625][INFO ][logstash.outputs.exec ]
[2019-08-27T00:13:50,831][INFO ][logstash.outputs.exec ]
[2019-08-27T00:13:51,036][INFO ][logstash.outputs.exec ]
[2019-08-27T00:13:51,239][INFO ][logstash.outputs.exec ]
Note: the message field content is the content of the input file which it's 800k rows so I truncated it.
Here's how the first row of the csv look like:
row_number,Time_float,V1_float,V2_float,V3_float,V4_float,V5_float,V6_float,V7_float,V8_float,V9_float,V10_float,V11_float,V12_float,V13_float,V14_float,V15_float,V16_float,V17_float,V18_float,V19_float,V20_float,V21_float,V22_float,V23_float,V24_float,V25_float,V26_float,V27_float,V28_float,Amount_float,Class_float
0,-1.996583023457193,-0.6942423209592997,-0.04407492457044802,1.6727734992241514,0.973365514375461,-0.24511658354252203,0.34706794516190337,0.19367893831762997,0.0826372794108694,0.33112778320993075,0.08338554524255039,-0.540407035731003,-0.6182957177945313,-0.9960989219768981,-0.32461018632700356,1.6040138389062168,-0.5368328685192513,0.24486345402090126,0.030769932602201018,0.4962820266510568,0.3261180160164485,-0.024923364961491876,0.38285443833968436,-0.17691133433749112,0.1105069205607409,0.2465854429694212,-0.3921704315485548,0.3308916226487169,-0.06378115069750527,0.24496426337017338,-0.04159897836869265