Hi everyone,
i try to use https://github.com/alcampos/graylog-plugin-function-csv from market place. I try to create rules on pipelines who extract value using this addons. Let me explain
- I have a filebeat input who receive csv logs file with a “log_type” added field.
- I have 3 streams for each “log_type” field value
- Heach stream have a associated pipeline with a rule (on stage 0) using csv addon for parsing
Here is an exemple for one of my 3 rules :
rule "Logtype_BOUNCE"
when
true
then
let csv_fields = "type,timeLogged,timeQueued,orig,rcpt,orcpt,dsnAction,dsnStatus,dsnDiag,dsnMta,bounceCat,srcType,srcMta,dlvType,dlvSourceIp,dlvDestinationIp,dlvEsmtpAvailable,dlvSize,vmta,jobId,envId,queue,vmtaPool,header_x-id,dsnReportingMta";
let csv_parsed = csv(csv_fields: csv_fields, csv_text: to_string($message.full_message), csv_separator: ",", dummy_value:"not_used");
set_fields(csv_parsed);
end
Here is a message exemple (from graylog message field), it’s a comma separated csv generated by a MTA. I anonymised values and somes fields could be empty :
b,2018-05-28 12:30:40+0200,2018-05-25 18:06:02+0200,bounce.XXXXXXXXXXXXXXX@XXXXXXX.fr,XXXXXXXX@XXXXX.fr,,failed,5.0.0 (undefined status),smtp;554 delivery error: dd Sorry your message to XXXXXXXXXX@XXXXXXX.fr cannot be delivered. This account has been disabled or discontinued [#102]. - mta1058.mail.ir2.yahoo.com,mx-eu.mail.am0.yahoodns.net (188.125.69.79),inactive-mailbox,smtp,XXXXX (XX.XX.XX.XX),smtp,XX.XX.XX.XX,XX.XX.XX.XX,"PIPELINING,8BITMIME,SIZE,STARTTLS",10755,XXXXX,,,yahoo-eu.rollup/XXXXX,,,
For debug :
- Addon installation OK : have the function on my pipeline rules editor
- nothing on server logs
- stream woks well i have logs routed on each
- no errors on rules menu
Processor Status
- |1| GeoIP Resolver| active|
- |2| Pipeline Processor| active|
- |3| AWS Instance Name Lookup| active|
- |4| Message Filter Chain| active|
Pipeline Simulation:
Simulation results
These are the results of processing the loaded message. Processing took 258 µs.
0 μs
Starting message processing
47 μs
Message 6275ef11-6272-11e8-b3b2-0050560102ca running [Pipeline 'logtype_BOUNCE' (5b0bcbc3d68d6b035a8f6b16)] for streams [5b0bcbadd68d6b035a8f6afb]
165 μs
Enter Stage 0
175 μs
Completed Stage 0 for Pipeline 'logtype_BOUNCE' (5b0bcbc3d68d6b035a8f6b16), continuing to next stage
180 μs
Exit Stage 0
188 μs
Finished message processing
Problem :
CSV addons doesnt extract values and no fields are creates.
Thanks for your help