DPL - multiline CSV content

Hi,

I’m working on a project where I need to parse a CSV file, but I’m not sure how to effectively read and handle each line of the text. I tried this without success :

{
“content”: “Server1;Infrastructure\Server2;Infrastructure\Server3;Infrastructure”,
“timestamp”: “2024-01-16T18:35:32.774000000 +0000”,
“log.source”: “inventory”

}

Thanks for your help!

Julien

Hi!

Did you try an array?

Hello,

here is a demonstartive statement:

data record(content ="""Server1;Infrastructure\Server2;Infrastructure\Server3;Infrastructure""")
| parse content, """ARRAY{(LD:host ';' LD:mode)('\\' | EOS)}{1,}:csv_arr"""
| expand csv_arr
| fieldsFlatten csv_arr
| fields host = csv_arr.host, mode = csv_arr.mode

Hi,

Perfect! Thanks a lot :slightly_smiling_face: