-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
adding timezone support to logparser timestamps #2882
Conversation
sebito91
commented
Jun 3, 2017
•
edited
Loading
edited
- Signed CLA.
- Associated README.md updated.
- Has appropriate unit tests.
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.
Looks great, just a few tweaks needed.
plugins/inputs/logparser/README.md
Outdated
@@ -7,15 +7,17 @@ regex patterns. | |||
### Configuration: | |||
|
|||
```toml | |||
[[inputs.logparser]] |
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.
Keep this line
plugins/inputs/logparser/README.md
Outdated
custom_pattern_files = [] | ||
## Custom patterns can also be defined here. Put one pattern per line. | ||
|
||
## Custom patterns can also be defined here. Put one pattern per line. |
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.
Use 2 space indention in here
@@ -155,9 +167,16 @@ func (p *Parser) Compile() error { | |||
p.Measurement = "logparser_grok" | |||
} | |||
|
|||
p.loc, err = time.LoadLocation(p.Timezone) | |||
if err != nil { | |||
log.Printf("D! improper timezone supplied (%s), setting loc to UTC", p.Timezone) |
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.
Log this as W!
## 1. Local -- interpret based on machine localtime | ||
## 2. "Canada/Eastern" -- Unix TZ values like those found in https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | ||
## 3. UTC -- or blank/unspecified, will return timestamp in UTC | ||
timezone = "Canada/Eastern" |
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.
2 space indention
Updated with requested changes. Apologies for the whitespace issues, new vimrc config :/ |