I’m trying to configure Filebeat to combine multiple lines into a single event and filter out unwanted lines.
My data looks like this:
632.5,684,0.984,0.641,0.228,L5B_CG,96.921
240.1,694,0.197,0.183,0.0241,L1D_CG,170
593.6,1021,0.131,0.183,0.0241,L2D_CG,161.250
,,너비,높이,결함 영역,,평균 명암도
,,,,,,
,,mm,mm,mm²,,
506.2,5,0.292,0.183,0.0321,,200.167
184.7,24,0.350,0.275,0.0802,,208.600
376.7,36,0.467,0.458,0.161,,202.400
after in filebeat message output just one event
"632.5,684,0.984,0.641,0.228,L5B_CG,96.921
240.1,694,0.197,0.183,0.0241,L1D_CG,170
593.6,1021,0.131,0.183,0.0241,L2D_CG,161.250
506.2,5,0.292,0.183,0.0321,,200.167
184.7,24,0.350,0.275,0.0802,,208.600
376.7,36,0.467,0.458,0.161,,202.400"
tried config
multiline.pattern: '^['
multiline.negate: true
multiline.match: after
multiline.max_lines: 50000
processors:
- script:
lang: javascript
id: filter_lines
source: >
function process(event) {
var lines = event.Get("message").split("\n");
var filteredLines = lines.filter(function(line) {
return /^[0-9]/.test(line);
});
event.Put("message", filteredLines.join("\n"));
}
I ran filebeat use this config
fileat closed when read txt file
please help me
New contributor
김종기 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.