Skip to content

Commit 7bc6bac

Browse files
committed
Update main.py
1 parent b55bbf5 commit 7bc6bac

File tree

1 file changed

+4
-1
lines changed
  • .github/actions/log_to_splunk

1 file changed

+4
-1
lines changed

.github/actions/log_to_splunk/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ def main():
6363

6464
print(json.dumps(summary))
6565

66-
event={'event':json.dumps(summary),'sourcetype':SPLUNK_SOURCETYPE,'source':'workflow_sumary','host':host,'time':summary["updated_at"]}
66+
utc_time = datetime.strptime(summary["updated_at"], "%Y-%m-%dT%H:%M:%SZ")
67+
epoch_time = (utc_time - datetime(1970, 1, 1)).total_seconds()
68+
69+
event={'event':json.dumps(summary),'sourcetype':SPLUNK_SOURCETYPE,'source':'workflow_sumary','host':host,'time':epoch_time}
6770
event=json.dumps(event)
6871

6972
print(event)

0 commit comments

Comments
 (0)