Skip to content

Commit

Permalink
rebase and address nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
ymtaye committed Oct 16, 2023
1 parent 3201655 commit d4ec621
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions plugins/outputs/cloudwatchlogs/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
)

const (
reqSizeLimit = 1024 * 1024
reqEventsLimit = 10000
logWarnInterval = 1 * 24 * time.Hour
reqSizeLimit = 1024 * 1024
reqEventsLimit = 10000
warnOldTimeStamp = 1 * 24 * time.Hour
)

var (
Expand Down Expand Up @@ -417,8 +417,8 @@ func (p *pusher) convertEvent(e logs.LogEvent) *cloudwatchlogs.InputLogEvent {
t = p.lastValidTime
if !p.lastUpdateTime.IsZero() {
// Check when timestamp has an interval of 5 days.
if time.Since(p.lastUpdateTime) > logWarnInterval {
p.Log.Warnf("Unable to parse timestamp, using last valid timestamp %v: which is at least older by 1 day for log group %v: ", p.lastValidTime, p.Group)
if time.Since(p.lastUpdateTime) > warnOldTimeStamp {
p.Log.Warnf("Unable to parse timestamp, using last valid timestamp found in the logs %v: which is at least older than 1 day for log group %v: ", p.lastValidTime, p.Group)
}
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions translator/tocwconfig/sampleConfig/no_skip_log_timestamp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
log_group_name = "amazon-cloudwatch-agent.log"
pipe = false
retention_in_days = -1
timestamp_layout = "15:04:05 06 Jan 02"
timestamp_regex = "(d{2}:d{2}:d{2} d{2} w{3} d{2})"
timestamp_layout = ["15:04:05 06 Jan _2"]
timestamp_regex = "(d{2}:d{2}:d{2} d{2} w{3} s{0,1} d{1,2})"

[outputs]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
log_group_name = "amazon-cloudwatch-agent.log"
pipe = false
retention_in_days = -1
timestamp_layout = "15:04:05 06 Jan 02"
timestamp_regex = "(d{2}:d{2}:d{2} d{2} w{3} d{2})"
timestamp_layout = ["15:04:05 06 Jan _2"]
timestamp_regex = "(d{2}:d{2}:d{2} d{2} w{3} s{0,1} d{1,2})"

[outputs]

Expand Down

0 comments on commit d4ec621

Please sign in to comment.