Skip to content
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

Add optional pid to regex expression for java log files for 2024.2 #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion LogShark/Plugins/Backgrounder/BackgrounderEventParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ public class BackgrounderEventParser
private static readonly Regex NewBackgrounderRegex =
// 10.4+
// 10.4 added "job type" and 10.5 added "local request id", either of which may be empty and thus are marked optional here
// 2024.2 added optional "pid" to match 2024.2, and made ts_offset more exclusionary
new Regex(@"^
(?<ts>\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3})
\s(?<ts_offset>[^\s]+)
\s(?<ts_offset>[-|+]\d+?)
\s?(?<pid>\d+)?
\s\((?<site>[^,]*), (?<user>[^,]*), (?<data_sess_id>[^,]*), (?<vql_sess_id>[^,]*), (?<job_id>[^,]*), :?(?<job_type>[^,]*) ,(?<local_req_id>[^\s]*)\)
\s?(?<module>[^\s]*)?
\s(?<thread>[^\s]*)
Expand Down
3 changes: 3 additions & 0 deletions LogShark/Plugins/ClusterController/ClusterControllerPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,11 @@ private void ProcessZookeeperLine(LogLine logLine)
private IWriter<ZookeeperError> _zkErrorWriter;
private IWriter<ZookeeperFsyncLatency> _zkFsyncLatencyWriter;

// 2024.2 added optional "pid" to match 2024.2
private static readonly Regex _clusterControllerLogsRegex = new Regex(@"^
(?<ts>\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3})\s
(?<ts_offset>.+?)\s
?(?<pid>\d+)?\s
(?<thread>.*?)\s
(?<sev>[A-Z]+)(\s+)
:\s
Expand Down Expand Up @@ -245,6 +247,7 @@ private void ProcessZookeeperLine(LogLine logLine)
private static readonly Regex _zookeeperRegex = new Regex(@"^
(?<ts>\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3})\s
(?<ts_offset>.+?)\s
?(?<pid>\d+)?\s
(?<thread>.*?)\s
:\s
(?<sev>[A-Z]+)(\s+)
Expand Down
3 changes: 2 additions & 1 deletion LogShark/Plugins/Filestore/FilestorePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ public class FilestorePlugin : IPlugin

private IWriter<FilestoreEvent> _writer;
private IProcessingNotificationsCollector _processingNotificationsCollector;

// 2024.2 added optional "pid" to match 2024.2
private readonly Regex _regex =
new Regex(@"^
(?<ts>\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3})\s
(?<ts_offset>.+?)\s
?(?<pid>\d+)?\s
(?<thread>.*?)\s+
(?<sev>[A-Z]+)(\s+)
:\s
Expand Down
2 changes: 2 additions & 0 deletions LogShark/Plugins/SearchServer/SearchServerPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ public class SearchServerPlugin : IPlugin
private IWriter<SearchServerEvent> _writer;
private IProcessingNotificationsCollector _processingNotificationsCollector;

// 2024.2 added optional "pid" to match 2024.2
private readonly Regex _regex = new Regex(@"^
(?<ts>\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3})\s
(?<ts_offset>.+?)\s
?(?<pid>\d+)?\s
\((?<site>.*?), (?<user>.*?), (?<sess>.*?), (?<req>.*?)\)\s
(?<thread>.*?)\s
:\s
Expand Down
4 changes: 3 additions & 1 deletion LogShark/Plugins/SharedRegex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ namespace LogShark.Plugins
{
public static class SharedRegex
{
// 2024.2 added optional "pid" to match 2024.2, and made ts_offset more exclusionary
public static readonly Regex JavaLogLineRegex = new Regex(@"^
(?<ts>\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3})\s
(?<ts_offset>[^\s]+?)\s
(?<ts_offset>[-|+]\d+)\s
?(?<pid>\d+)?\s
\((?<site>[^,]*?), (?<user>[^,]*?), (?<sess>[^,]*?), (?<req>[^,\)]*?) (,(?<local_req_id>[^\)]*?))?\)\s
(?<thread>[^\s]*?)\s
(?<service>[^:]*?)?:\s
Expand Down