How to convert UiPath execution log file to Json or XML format

Hello everyone,

I want to extract certain details from UiPath Execution log file

Please suggest on any ideas
And How to convert Execution log file to JSON or XML format?

Thanks
Neha

Hello @Neha_Kumari1

Check if this thread helps: How to convert the excel output data into json file?

1 Like

Hi

Have a look on this thread

Cheers @Neha_Kumari1

1 Like

in addition to:

lets have a look on following:

depending, on what you want to extract it can be done e.g. with Regex
or Deserialiting the {…} to JSON or both combined

lets assume format below for the execution log
13:06:03.1566 Info {“message”:"### execution started",“level”:“Information”,“logType”:“Default”,…}

it already very close to JSON as parts of it are JSON {…}

So just let us know your details and extraction needs, so we can adress more indiviudally your case

1 Like

Thanks a lot @Parth_Doshi , @Palaniyappan , @ppr for your inputs :blush:
I’ll try same at my end and would revert if get stuck

Hi @ppr ,

Thanks for responding.
My execution log format is in that only, what you stated. Attaching also the sample file for your reference.
And I tried going with Regex, not so comfortable with it for now. Could you please suggest how to go with deserializing in this? or any other possible way out there
From this log file, I need to extract data as such,
. Process Start Time
.Name Of Process
.Process Transaction Count
.Execution Duration (Process End Time- Process Start Time)
SampleExecution.txt (51.0 KB)

@Neha_Kumari1

just find some introductions to the main building blocks.

Filtering / Preprocessing the log lines:
grafik

with regex we do find the JSON part
Let jo = … we do parse a string into a JObject
also did some demonstrations on retrieval, filterings, and orderings

there are some jobs that do not have an end log. So it is suggested to group the lines on the job id:
grafik

finally, we demonstrate on a prototype level on how a report data table can be populated including handling the missing endlines:

Result:
grafik

Kindly note: No of Transaction Info is not in the logs:

  • can be added e.g. with a custom log field
  • ORC API
  • ensure Namespaces are imported: Newtonssoft.Json,Newtonssoft.Json.Linq, System.Text.RegularExpressions

find starter help here:
ExecLogExtractor_Demo1.xaml (13.1 KB)

further info on LINQ and Regex

1 Like

Thanks a ton @ppr
This is amazing

Will surely do the homeworks, you suggested below…

Hi @ppr,

Thanks a lot for your efforts.
I was trying to add some extra columns to it. Some working well.
And could you please suggest on how to add an item that’s only available in, say, last log message, like if I wish to extract “totalExecutionTime” from the Execution log file.

Updated-Got it. Thanks…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.