New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logging: add ISO-like timestamp option - v1 #8317
Conversation
Adds a new logging format character, %z that uses a more standard time format of "YYYY-MM-DD HH:MM:SS". Ticket OISF#5764
The default-log-format has changed, reflect this in the suricata.yaml.
Also update suricata.yaml to show this default, as updating the "default-log-format" does not affect the file output.
- Update fragment of configuration file to match suricata.yaml with new default-log-format. - Document new %z format specifier.
while ( (temp_fmt = strchr(temp_fmt, SC_LOG_FMT_PREFIX)) ) { | ||
while ((temp_fmt = strchr(temp_fmt, SC_LOG_FMT_PREFIX))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #8317 +/- ##
==========================================
+ Coverage 81.83% 81.89% +0.06%
==========================================
Files 963 963
Lines 277131 277310 +179
==========================================
+ Hits 226791 227108 +317
+ Misses 50340 50202 -138
Flags with carried forward coverage won't be shown. Click here to find out more. |
Information:
Pipeline 11284 |
t: Time, timestamp, time and date | ||
example: 15/10/2010 - -11:40:07 | ||
z: ISO-like formatted timestamp: YYYY-MM-DD HH:MM:SS | ||
t: Original Suricata log timestamp: DD/MM/YYYY -- HH:MM::SS | ||
p: Process ID. Suricata's whole processing consists of multiple threads. | ||
i: Thread ID. ID of individual threads. | ||
m: Thread module name. (Outputs, Detect etc.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the recent changes by Victor, I think that this section is missing a few options (D, M, S, T, from what I can see).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation-wise looks good - although it made me realize we are missing explaining a few of the format options - left a comment inline. Case this PR is ready to merge, I can submit one to fix that bit up.
Merged in #8360, thanks! |
Add a new log format specifier
%z
to use a more ISO-like timestamp formatYYYY-MM-DD HH:MM:SS
that is more commonly used in logs these days.Ticket: https://redmine.openinfosecfoundation.org/issues/5764