cancel
Showing results for 
Search instead for 
Did you mean: 

change Date gateway Configuration to get time stamp at the beginning of each line

AyyoubBenoudina
Level 4
Hi Community

I'm using Data-Gateway to write Logs in a file.
I didn't change the Default configuration:

if [event][EventType] == 1 or [event][EventType] == 4 or [event][EventType] == 3 {
file {
path => "D:\Log\Session-Queue_logs_%{+YYYY-MM-dd}.txt"
codec => line { format => "%{event}"}
}
}

I'm asking if there is a way to change the Configuration, in order to have the Time Stamp in the beginning of each Line in Logs?

Thanks in advance,
Best regards,
Ayyoub

------------------------------
Ayyoub Benoudina
------------------------------
1 BEST ANSWER

Helpful Answers

james.man
Staff
Staff
Hi,

You can change your codec line to something like:
codec => line { format => "%{[event][EventData][StartDate]} %{[event]}" }
25656.png

Which will give the StartDate of the session log, followed by a space, then the rest of the event data in JSON format.

If you don't want the StartDate to be the first line, you can find all of the potential session log data fields can be found here:
https://bpdocs.blueprism.com/bp-6-9/en-us/Guides/data-gateways/dg-config-file.htm?tocpath=Guides%7CData%20Gateways%7C_____10#Event

------------------------------
James Man
Professional Services
Blue Prism
Asia/Hong_Kong
------------------------------

View answer in original post

1 REPLY 1

james.man
Staff
Staff
Hi,

You can change your codec line to something like:
codec => line { format => "%{[event][EventData][StartDate]} %{[event]}" }
25656.png

Which will give the StartDate of the session log, followed by a space, then the rest of the event data in JSON format.

If you don't want the StartDate to be the first line, you can find all of the potential session log data fields can be found here:
https://bpdocs.blueprism.com/bp-6-9/en-us/Guides/data-gateways/dg-config-file.htm?tocpath=Guides%7CData%20Gateways%7C_____10#Event

------------------------------
James Man
Professional Services
Blue Prism
Asia/Hong_Kong
------------------------------