Skip to content

Commit

Permalink
handle printing json data in scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmelt committed Nov 21, 2021
1 parent d076889 commit 760ebb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cosmos-script-runner-api/app/models/running_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1049,13 +1049,13 @@ def handle_output_io(filename = @current_filename, line_number = @current_line_n
string.each_line do |out_line|
begin
json = JSON.parse(out_line)
time_formatted = json["@timestamp"]
out_line = json["log"]
time_formatted = json["@timestamp"] if json["@timestamp"]
out_line = json["log"] if json["log"]
rescue
# Regular output
end

if out_line[0..1] == '20' and out_line[10] == ' ' and out_line[23..24] == ' ('
if out_line.length >= 25 and out_line[0..1] == '20' and out_line[10] == ' ' and out_line[23..24] == ' ('
line_to_write = out_line
else
if filename
Expand Down

0 comments on commit 760ebb2

Please sign in to comment.