Skip to content

adding timezone support to logparser timestamps#2882

Merged
danielnelson merged 1 commit intoinfluxdata:masterfrom
sebito91:timezone
Jun 5, 2017
Merged

adding timezone support to logparser timestamps#2882
danielnelson merged 1 commit intoinfluxdata:masterfrom
sebito91:timezone

Conversation

@sebito91
Copy link
Contributor

@sebito91 sebito91 commented Jun 3, 2017

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

Copy link
Contributor

@danielnelson danielnelson left a 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.

### Configuration:

```toml
[[inputs.logparser]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep this line

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.
Copy link
Contributor

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


p.loc, err = time.LoadLocation(p.Timezone)
if err != nil {
log.Printf("D! improper timezone supplied (%s), setting loc to UTC", p.Timezone)
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 space indention

@sebito91
Copy link
Contributor Author

sebito91 commented Jun 5, 2017

Updated with requested changes. Apologies for the whitespace issues, new vimrc config :/

@danielnelson danielnelson merged commit 035905d into influxdata:master Jun 5, 2017
@sebito91 sebito91 deleted the timezone branch June 13, 2017 07:32
jeichorn pushed a commit to jeichorn/telegraf that referenced this pull request Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants