cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DPL - multiline CSV content

jegron
DynaMight Champion
DynaMight Champion

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"

}

jegron_0-1705432639202.png

jegron_1-1705432666149.png

Thanks for your help!

Julien

 

Observability Engineer at Phenisys - Dynatrace Professional
3 REPLIES 3

Hi!

Did you try an array?

Pawel_Zalewski_0-1705479181530.png

 

"The lions does not ally with the coyotes"

peter_zahrer
Dynatrace Champion
Dynatrace Champion

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

 

jegron
DynaMight Champion
DynaMight Champion

Hi,

Perfect! Thanks a lot 🙂

Observability Engineer at Phenisys - Dynatrace Professional

Featured Posts