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 support for comma in timestamp format #4311

Merged
merged 5 commits into from
Jun 21, 2018
Merged

Conversation

Ayrdrie
Copy link
Contributor

@Ayrdrie Ayrdrie commented Jun 18, 2018

Required for all PRs:

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

@@ -186,6 +186,7 @@ func (p *Parser) Compile() error {

// ParseLine is the primary function to process individual lines, returning the metrics
func (p *Parser) ParseLine(line string) (telegraf.Metric, error) {

Copy link
Contributor

Choose a reason for hiding this comment

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

Undo these whitespace changes, so that git history will be a little easier to read.

}

require.NoError(t, p.Compile())
m, err := p.ParseLine("2018-02-21 13:10:34.555 successfulMatches=1")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should have a comma separator in here right?

@@ -293,6 +294,7 @@ func (p *Parser) ParseLine(line string) (telegraf.Metric, error) {
timestamp = time.Unix(0, iv)
}
case SYSLOG_TIMESTAMP:

Copy link
Contributor

Choose a reason for hiding this comment

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

Undo whitespace change.

"reference time", which is `Mon Jan 2 15:04:05 -0700 MST 2006`
"reference time", which is `Mon Jan 2 15:04:05 -0700 MST 2006`. Both a comma
and a period are supported as a number separator.
EX: timestamp:ts-"2006-01-02 15:04:05.000" or timestamp:ts-"2006-01-02 15:04:05,000"
Copy link
Contributor

Choose a reason for hiding this comment

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

While you can have a comma in the parsed string, in the ts-"" format string it will have to be dot right now unless you replace it in the format string too.

@danielnelson danielnelson added this to the 1.7.1 milestone Jun 18, 2018
@danielnelson danielnelson added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin area/tail labels Jun 18, 2018
@danielnelson danielnelson modified the milestones: 1.7.1, 1.8.0 Jun 18, 2018
@danielnelson
Copy link
Contributor

closes #3571

@danielnelson danielnelson merged commit 61e197d into master Jun 21, 2018
@danielnelson danielnelson deleted the logparser-comma-support branch June 21, 2018 21:19
mkboudreau added a commit to mkboudreau/telegraf that referenced this pull request Jun 22, 2018
* origin: (39 commits)
  Document path tag in tail input
  Update changelog
  Added path tag to tail input plugin (influxdata#4292)
  Run windows tests with -short
  Fix postfix input handling of multi-level queues (influxdata#4333)
  Update changelog
  Add support for comma in logparser timestamp format (influxdata#4311)
  Update vendoring to dep from gdm (influxdata#4314)
  Update changelog
  Add new measurement with results of pgrep lookup to procstat input (influxdata#4307)
  Update changelog
  Add valuecounter aggregator plugin (influxdata#3523)
  Update changelog
  Update docker input documentation for container status
  Add container status tag to docker input (influxdata#4259)
  Drop CI support for Go 1.8 (influxdata#4309)
  Update changelog
  Fix selection of tags under nested objects in the JSON parser (influxdata#4284)
  Update changelog
  Add owner tag on partitions in burrow input (influxdata#4281)
  ...
rgitzel pushed a commit to rgitzel/telegraf that referenced this pull request Oct 17, 2018
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tail feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants