Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Does anyone have experience or working code that parses the output of strace command?
Copilot can up with this but is does not work ...
let
// Function to parse a single line of strace output
ParseStraceLine = (line as text) as record =>
let
// Find the position of the first parenthesis
openParen = List.First(Text.PositionOf(line, "(", Occurrence.First)),
// Find the position of the last parenthesis
closeParen = List.First(Text.PositionOf(line, ")", Occurrence.First, openParen)),
// Extract the syscall name
syscall = if openParen > 0 then Text.Start(line, openParen) else null,
// Extract the arguments
args = if openParen > 0 and closeParen > openParen then Text.Middle(line, openParen + 1, closeParen - openParen - 1) else null,
// Extract the result
resultStart = List.First(Text.PositionOf(line, "=", Occurrence.First, closeParen)) + 2,
result = if resultStart > 1 then Text.Middle(line, resultStart) else null,
// Create a record with the parsed data
parsedRecord = if syscall <> null and args <> null and result <> null then
[Syscall = syscall, Args = args, Result = result]
else
null
in
parsedRecord,
// Load the strace output from a text file
Source = Text.FromBinary(File.Contents("strace_output.txt")),
Lines = Text.Split(Source, "#(lf)"),
// Parse each line and filter out null values
ParsedLines = List.Transform(Lines, each ParseStraceLine(_)),
FilteredLines = List.Select(ParsedLines, each _ <> null),
// Convert the list of records to a table
Table = Table.FromRecords(FilteredLines)
in
Table
Solved! Go to Solution.
Hi @Anonymous ,
Powerquery does not have a built-in m function for parsing strace results. It is difficult to parse strace results directly using powerquery, so try to process them upstream before pulling them into powerquery.
parsing - How to parse strace in shell into plain text? - Stack Overflow
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi @Anonymous ,
Powerquery does not have a built-in m function for parsing strace results. It is difficult to parse strace results directly using powerquery, so try to process them upstream before pulling them into powerquery.
parsing - How to parse strace in shell into plain text? - Stack Overflow
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
12 | |
11 | |
9 | |
6 | |
6 |