{"action":"created","comment":{"url":"https://api.github.com/repos/influxdata/telegraf/pulls/comments/108574089","pull_request_review_id":29611855,"id":108574089,"diff_hunk":"@@ -1274,6 +1285,13 @@ func buildSerializer(name string, tbl *ast.Table) (serializers.Serializer, error\n \t\t}\n \t}\n \n+\t// if the output data format is JSON, then set the timestamp\n+\t// units for the serializer configuration to the units that were\n+\t// defined in the AgentConfig\n+\tif c.DataFormat == \"json\" {\n+\t\tc.TimestampUnits = agentConfig.JsonTimestampUnits\n+\t}\n+\n \tdelete(tbl.Fields, \"data_format\")\n \tdelete(tbl.Fields, \"prefix\")\n \tdelete(tbl.Fields, \"template\")","path":"internal/config/config.go","position":69,"original_position":69,"commit_id":"630e617d50e8e06134543090f54ce2fddf435855","original_commit_id":"630e617d50e8e06134543090f54ce2fddf435855","user":{"login":"danielnelson","id":1048079,"avatar_url":"https://avatars0.githubusercontent.com/u/1048079?v=3","gravatar_id":"","url":"https://api.github.com/users/danielnelson","html_url":"https://github.com/danielnelson","followers_url":"https://api.github.com/users/danielnelson/followers","following_url":"https://api.github.com/users/danielnelson/following{/other_user}","gists_url":"https://api.github.com/users/danielnelson/gists{/gist_id}","starred_url":"https://api.github.com/users/danielnelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielnelson/subscriptions","organizations_url":"https://api.github.com/users/danielnelson/orgs","repos_url":"https://api.github.com/users/danielnelson/repos","events_url":"https://api.github.com/users/danielnelson/events{/privacy}","received_events_url":"https://api.github.com/users/danielnelson/received_events","type":"User","site_admin":false},"body":"Don't forget to delete the field here after making the above change.","created_at":"2017-03-29T01:17:10Z","updated_at":"2017-03-29T01:32:37Z","html_url":"https://github.com/influxdata/telegraf/pull/2587#discussion_r108574089","pull_request_url":"https://api.github.com/repos/influxdata/telegraf/pulls/2587","_links":{"self":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/comments/108574089"},"html":{"href":"https://github.com/influxdata/telegraf/pull/2587#discussion_r108574089"},"pull_request":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/2587"}}},"pull_request":{"url":"https://api.github.com/repos/influxdata/telegraf/pulls/2587","id":113095739,"html_url":"https://github.com/influxdata/telegraf/pull/2587","diff_url":"https://github.com/influxdata/telegraf/pull/2587.diff","patch_url":"https://github.com/influxdata/telegraf/pull/2587.patch","issue_url":"https://api.github.com/repos/influxdata/telegraf/issues/2587","number":2587,"state":"open","locked":false,"title":"Adds a new json_timestamp_units configuration parameter","user":{"login":"tjmcs","id":1375734,"avatar_url":"https://avatars2.githubusercontent.com/u/1375734?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmcs","html_url":"https://github.com/tjmcs","followers_url":"https://api.github.com/users/tjmcs/followers","following_url":"https://api.github.com/users/tjmcs/following{/other_user}","gists_url":"https://api.github.com/users/tjmcs/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmcs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmcs/subscriptions","organizations_url":"https://api.github.com/users/tjmcs/orgs","repos_url":"https://api.github.com/users/tjmcs/repos","events_url":"https://api.github.com/users/tjmcs/events{/privacy}","received_events_url":"https://api.github.com/users/tjmcs/received_events","type":"User","site_admin":false},"body":"Resolves #2124\r\n\r\nThe changes in this pull request add a new `json_timestamp_units` parameter to the Telegraf agent configuration, giving users the ability to define the which units should be used when reporting back the timestamps associated with a given metric when that metric is output as JSON.  Currently, the Telegraf agent simply returns a timestamp for those metrics in seconds when the metrics are output in JSON format (regardless of the precision that was used in generating the timestamp itself), while the same timestamps are returned in nanoseconds for if those metrics are output in the InfluxDB format.  Specifically, this pull request changes the Telegraf configuration file and the JSON serializer as follows in order to enable reporting of the timestamps associated with JSON formatted metrics in units other than seconds:\r\n\r\n* a new `JsonTimestampUnits` field has been added to the `AgentConfig` struct that is defined in the `internal/config/config.go` file, and that field is initialized to a default value of one second when a new instance of this struct is created (ensuring that when the changes in this pull request are merged into the master branch the new version of the Telegraf agent will still work with the `telegraf.conf` files that were generated by previous versions of the Telegraf agent).\r\n* a new `json_timestamp_units` field has been added to the `[agent]` section of the header that is defined in that same `internal/config/config.go` file; this is the header that is used to fill in the `[agent]` section of a new Telegraf configuration file when generating that file using a `telegraf ... config` command.  Note that we have left this parameter commented out in the resulting configuration file to prove that if it is undefined the timestamps output for JSON formatted metrics will still be in seconds (the default), but the line is there as an example to the user of how they might set this parameter to a value other than the `1s` default that is shown.\r\n* the `buildSerializer` function signature in that same file has been changed to take an additional argument (a pointer to the `AgentConfig` struct), and that struct is used within the `buildSerializer` function to set the new `TimestampUnits` field that we've added to the `Config` struct defined in the `plugins/serializers/registry.go` file; this is the same location where the `Prefix` and `Template` fields used by the Graphite serializer are defined, so we felt that the `TimestampUnits` used in outputting JSON formatted metrics should be added to this struct as well.\r\n* the JSON serializer has been modified to include a new `TimestampUnits` field in the `JsonSerializer` struct defined in the `plugins/serializers/json/json.go` file, and that new field is used to ensure that the timestamps output by this serializer are in the correct units (by dividing by the number of nanoseconds in the defined `TimestampUnits` duration rather than simply dividing the nanoseconds in the metric timestamp by `1,000,000,000`).\r\n* the `NewJsonSerializer` function defined in the `plugins/serializers/registry.go` file has been modified to accept an argument defining the timestampUnits that the serializer should use\r\n\r\nThis set of changes was the minimal set of changes that we felt we could make that would add the desired behavior while still maintaining the default behavior of the current system (where timestamps for JSON formatted metrics are output in seconds, by default).  We were also careful to ensure that the current Telegraf configuration files could still be used with the new version of the Telegraf agent.\r\n\r\nTo provide an example of how the changes in this pull request work, we first generated a configuration file that outputs the `system` metrics to the `file` output filter using the current released version of Telegraf (v1.2.1):\r\n\r\n```bash\r\n$ telegraf version\r\nTelegraf v1.2.1 (git: release-1.2 3b6ffb344e5c03c1595d862282a6823ecb438cff)\r\n$ telegraf -input-filter 'system' -output-filter 'file' config | tee telegraf-current.conf\r\n# Telegraf Configuration\r\n#\r\n# Telegraf is entirely plugin driven. All metrics are gathered from the\r\n# declared inputs, and sent to the declared outputs.\r\n#\r\n# Plugins must be declared in here to be active.\r\n# To deactivate a plugin, comment out the name and any variables.\r\n#\r\n# Use 'telegraf -config telegraf.conf -test' to see what metrics a config\r\n# file would generate.\r\n#\r\n# Environment variables can be used anywhere in this config file, simply prepend\r\n# them with $. For strings the variable must be within quotes (ie, \"$STR_VAR\"),\r\n# for numbers and booleans they should be plain (ie, $INT_VAR, $BOOL_VAR)\r\n\r\n\r\n# Global tags can be specified here in key=\"value\" format.\r\n[global_tags]\r\n  # dc = \"us-east-1\" # will tag all metrics with dc=us-east-1\r\n  # rack = \"1a\"\r\n  ## Environment variables can be used as tags, and throughout the config file\r\n  # user = \"$USER\"\r\n\r\n\r\n# Configuration for telegraf agent\r\n[agent]\r\n  ## Default data collection interval for all inputs\r\n  interval = \"10s\"\r\n  ## Rounds collection interval to 'interval'\r\n  ## ie, if interval=\"10s\" then always collect on :00, :10, :20, etc.\r\n  round_interval = true\r\n\r\n  ## Telegraf will send metrics to outputs in batches of at most\r\n  ## metric_batch_size metrics.\r\n  ## This controls the size of writes that Telegraf sends to output plugins.\r\n  metric_batch_size = 1000\r\n\r\n  ## For failed writes, telegraf will cache metric_buffer_limit metrics for each\r\n  ## output, and will flush this buffer on a successful write. Oldest metrics\r\n  ## are dropped first when this buffer fills.\r\n  ## This buffer only fills when writes fail to output plugin(s).\r\n  metric_buffer_limit = 10000\r\n\r\n  ## Collection jitter is used to jitter the collection by a random amount.\r\n  ## Each plugin will sleep for a random time within jitter before collecting.\r\n  ## This can be used to avoid many plugins querying things like sysfs at the\r\n  ## same time, which can have a measurable effect on the system.\r\n  collection_jitter = \"0s\"\r\n\r\n  ## Default flushing interval for all outputs. You shouldn't set this below\r\n  ## interval. Maximum flush_interval will be flush_interval + flush_jitter\r\n  flush_interval = \"10s\"\r\n  ## Jitter the flush interval by a random amount. This is primarily to avoid\r\n  ## large write spikes for users running a large number of telegraf instances.\r\n  ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s\r\n  flush_jitter = \"0s\"\r\n\r\n  ## By default, precision will be set to the same timestamp order as the\r\n  ## collection interval, with the maximum being 1s.\r\n  ## Precision will NOT be used for service inputs, such as logparser and statsd.\r\n  ## Valid values are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\".\r\n  precision = \"\"\r\n\r\n  ## Logging configuration:\r\n  ## Run telegraf with debug log messages.\r\n  debug = false\r\n  ## Run telegraf in quiet mode (error log messages only).\r\n  quiet = false\r\n  ## Specify the log file name. The empty string means to log to stderr.\r\n  logfile = \"\"\r\n\r\n  ## Override default hostname, if empty use os.Hostname()\r\n  hostname = \"\"\r\n  ## If set to true, do no set the \"host\" tag in the telegraf agent.\r\n  omit_hostname = false\r\n\r\n\r\n###############################################################################\r\n#                            OUTPUT PLUGINS                                   #\r\n###############################################################################\r\n\r\n# Send telegraf metrics to file(s)\r\n[[outputs.file]]\r\n  ## Files to write to, \"stdout\" is a specially handled file.\r\n  files = [\"stdout\", \"/tmp/metrics.out\"]\r\n\r\n  ## Data format to output.\r\n  ## Each data format has it's own unique set of configuration options, read\r\n  ## more about them here:\r\n  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md\r\n  data_format = \"influx\"\r\n\r\n\r\n\r\n###############################################################################\r\n#                            PROCESSOR PLUGINS                                #\r\n###############################################################################\r\n\r\n# # Print all metrics that pass through this filter.\r\n# [[processors.printer]]\r\n\r\n\r\n\r\n###############################################################################\r\n#                            AGGREGATOR PLUGINS                               #\r\n###############################################################################\r\n\r\n# # Keep the aggregate min/max of each metric passing through.\r\n# [[aggregators.minmax]]\r\n#   ## General Aggregator Arguments:\r\n#   ## The period on which to flush & clear the aggregator.\r\n#   period = \"30s\"\r\n#   ## If true, the original metric will be dropped by the\r\n#   ## aggregator and will not get sent to the output plugins.\r\n#   drop_original = false\r\n\r\n\r\n\r\n###############################################################################\r\n#                            INPUT PLUGINS                                    #\r\n###############################################################################\r\n\r\n# Read metrics about system load & uptime\r\n[[inputs.system]]\r\n  # no configuration\r\n\r\n$ \r\n```\r\nWe then modified the `precision` in the `[agent]` section of the configuration file so that the precision is in nanoseconds (i.e. we set the `precision` value to `1ns`), and started up the telegraf agent using the (slightly) modified configuration file, capturing the first set of metrics reported (note that the configuration file generated, above, has the `data_format` for the `file` output filter set to `influx`, so the timestamps shown in this snippet are in nanoseconds):\r\n```bash\r\n$ telegraf --config telegraf-current.conf\r\n2017-03-28T23:52:22Z I! Starting Telegraf (version 1.2.1)\r\n2017-03-28T23:52:22Z I! Loaded outputs: file\r\n2017-03-28T23:52:22Z I! Loaded inputs: inputs.system\r\n2017-03-28T23:52:22Z I! Tags enabled: host=localhost.localdomain\r\n2017-03-28T23:52:22Z I! Agent Config: Interval:10s, Quiet:false, Hostname:\"localhost.localdomain\", Flush Interval:10s\r\nsystem,host=localhost.localdomain load1=0,load5=0.01,load15=0.05,n_users=1i,n_cpus=1i 1490745150008486243\r\nsystem,host=localhost.localdomain uptime=70723i,uptime_format=\"19:38\" 1490745150008510607\r\nsystem,host=localhost.localdomain n_users=1i,n_cpus=1i,load1=0,load5=0.01,load15=0.05 1490745160006246662\r\nsystem,host=localhost.localdomain uptime=70733i,uptime_format=\"19:38\" 1490745160006278303\r\n...\r\n$ \r\n```\r\nNext, we modified the `data_format` in our `file` output filter so that the metrics would be output in a `json` data format and restarted the agent, the result was that the timestamps that were output by the same `file` output filter are now in seconds, rather than nanoseconds:\r\n```bash\r\n$ telegraf --config telegraf-current.conf\r\n2017-03-28T23:54:27Z I! Starting Telegraf (version 1.2.1)\r\n2017-03-28T23:54:27Z I! Loaded outputs: file\r\n2017-03-28T23:54:27Z I! Loaded inputs: inputs.system\r\n2017-03-28T23:54:27Z I! Tags enabled: host=localhost.localdomain\r\n2017-03-28T23:54:27Z I! Agent Config: Interval:10s, Quiet:false, Hostname:\"localhost.localdomain\", Flush Interval:10s\r\n{\"fields\":{\"load1\":0,\"load15\":0.05,\"load5\":0.01,\"n_cpus\":1,\"n_users\":1},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490745270}\r\n{\"fields\":{\"uptime\":70843,\"uptime_format\":\"19:40\"},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490745270}\r\n{\"fields\":{\"load1\":0,\"load15\":0.05,\"load5\":0.01,\"n_cpus\":1,\"n_users\":1},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490745280}\r\n{\"fields\":{\"uptime\":70853,\"uptime_format\":\"19:40\"},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490745280}\r\n...\r\n$ \r\n```\r\nSo that demonstrates the issue we are resolving in this pull request.  Since there is no way to set the units associated with the timestamp for JSON formatted metrics, we cannot get the timestamps for our metrics in any units other than seconds, regardless of the precision with which that timestamp was measured when the metric was collected.\r\n\r\nWith the changes in this PR, we can generate a new configuration file that looks like this:\r\n```bash\r\n$ ./telegraf version\r\nTelegraf vdev-102-g630e617 (git: tb/add-json-timestamp-units 630e617)\r\n$ ./telegraf -input-filter 'system' -output-filter 'file' config | tee telegraf-new.conf\r\n# Telegraf Configuration\r\n#\r\n# Telegraf is entirely plugin driven. All metrics are gathered from the\r\n# declared inputs, and sent to the declared outputs.\r\n#\r\n# Plugins must be declared in here to be active.\r\n# To deactivate a plugin, comment out the name and any variables.\r\n#\r\n# Use 'telegraf -config telegraf.conf -test' to see what metrics a config\r\n# file would generate.\r\n#\r\n# Environment variables can be used anywhere in this config file, simply prepend\r\n# them with $. For strings the variable must be within quotes (ie, \"$STR_VAR\"),\r\n# for numbers and booleans they should be plain (ie, $INT_VAR, $BOOL_VAR)\r\n\r\n\r\n# Global tags can be specified here in key=\"value\" format.\r\n[global_tags]\r\n  # dc = \"us-east-1\" # will tag all metrics with dc=us-east-1\r\n  # rack = \"1a\"\r\n  ## Environment variables can be used as tags, and throughout the config file\r\n  # user = \"$USER\"\r\n\r\n\r\n# Configuration for telegraf agent\r\n[agent]\r\n  ## Default data collection interval for all inputs\r\n  interval = \"10s\"\r\n  ## Rounds collection interval to 'interval'\r\n  ## ie, if interval=\"10s\" then always collect on :00, :10, :20, etc.\r\n  round_interval = true\r\n\r\n  ## Telegraf will send metrics to outputs in batches of at most\r\n  ## metric_batch_size metrics.\r\n  ## This controls the size of writes that Telegraf sends to output plugins.\r\n  metric_batch_size = 1000\r\n\r\n  ## For failed writes, telegraf will cache metric_buffer_limit metrics for each\r\n  ## output, and will flush this buffer on a successful write. Oldest metrics\r\n  ## are dropped first when this buffer fills.\r\n  ## This buffer only fills when writes fail to output plugin(s).\r\n  metric_buffer_limit = 10000\r\n\r\n  ## Collection jitter is used to jitter the collection by a random amount.\r\n  ## Each plugin will sleep for a random time within jitter before collecting.\r\n  ## This can be used to avoid many plugins querying things like sysfs at the\r\n  ## same time, which can have a measurable effect on the system.\r\n  collection_jitter = \"0s\"\r\n\r\n  ## Default flushing interval for all outputs. You shouldn't set this below\r\n  ## interval. Maximum flush_interval will be flush_interval + flush_jitter\r\n  flush_interval = \"10s\"\r\n  ## Jitter the flush interval by a random amount. This is primarily to avoid\r\n  ## large write spikes for users running a large number of telegraf instances.\r\n  ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s\r\n  flush_jitter = \"0s\"\r\n\r\n  ## By default, precision will be set to the same timestamp order as the\r\n  ## collection interval, with the maximum being 1s.\r\n  ## Precision will NOT be used for service inputs, such as logparser and statsd.\r\n  ## Valid values are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\".\r\n  precision = \"\"\r\n\r\n  ## Logging configuration:\r\n  ## Run telegraf with debug log messages.\r\n  debug = false\r\n  ## Run telegraf in quiet mode (error log messages only).\r\n  quiet = false\r\n  ## Specify the log file name. The empty string means to log to stderr.\r\n  logfile = \"\"\r\n\r\n  ## Override default hostname, if empty use os.Hostname()\r\n  hostname = \"\"\r\n  ## If set to true, do no set the \"host\" tag in the telegraf agent.\r\n  omit_hostname = false\r\n\r\n  ## used to set the timestamp units that should be used when the output is\r\n  ## in JSON format; valid values are \"ns\", \"us\" (or \"µs\"), \"ms\", or \"s\",\r\n  ## and the default units if not specified are \"s\"\r\n  #json_timestamp_units = \"1s\"\r\n\r\n\r\n###############################################################################\r\n#                            OUTPUT PLUGINS                                   #\r\n###############################################################################\r\n\r\n# Send telegraf metrics to file(s)\r\n[[outputs.file]]\r\n  ## Files to write to, \"stdout\" is a specially handled file.\r\n  files = [\"stdout\", \"/tmp/metrics.out\"]\r\n\r\n  ## Data format to output.\r\n  ## Each data format has it's own unique set of configuration options, read\r\n  ## more about them here:\r\n  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md\r\n  data_format = \"influx\"\r\n\r\n\r\n\r\n###############################################################################\r\n#                            PROCESSOR PLUGINS                                #\r\n###############################################################################\r\n\r\n# # Print all metrics that pass through this filter.\r\n# [[processors.printer]]\r\n\r\n\r\n\r\n###############################################################################\r\n#                            AGGREGATOR PLUGINS                               #\r\n###############################################################################\r\n\r\n# # Keep the aggregate min/max of each metric passing through.\r\n# [[aggregators.minmax]]\r\n#   ## General Aggregator Arguments:\r\n#   ## The period on which to flush & clear the aggregator.\r\n#   period = \"30s\"\r\n#   ## If true, the original metric will be dropped by the\r\n#   ## aggregator and will not get sent to the output plugins.\r\n#   drop_original = false\r\n\r\n\r\n\r\n###############################################################################\r\n#                            INPUT PLUGINS                                    #\r\n###############################################################################\r\n\r\n# Read metrics about system load & uptime\r\n[[inputs.system]]\r\n  # no configuration\r\n\r\n$ \r\n```\r\nNote that this version of the Telegraf agent includes the new parameter (and comments associated with it) in the `[agent]` section of the configuration file:\r\n```bash\r\n  ## used to set the timestamp units that should be used when the output is\r\n  ## in JSON format; valid values are \"ns\", \"us\" (or \"µs\"), \"ms\", or \"s\",\r\n  ## and the default units if not specified are \"s\"\r\n  #json_timestamp_units = \"1s\"\r\n```\r\nOnce again, we changed the precision to `1ns` in the agent configuration and we set the `data_format` for our `file` output filter to `json`; with these changes in place we got the same behavior that we've seen all along in the JSON formatted metrics that are reported by the new version of the Telegraf agent:\r\n```bash\r\n$ ./telegraf --config telegraf-new.conf\r\n2017-03-29T00:26:51Z I! Starting Telegraf (version dev-102-g630e617)\r\n2017-03-29T00:26:51Z I! Loaded outputs: file\r\n2017-03-29T00:26:51Z I! Loaded inputs: inputs.system\r\n2017-03-29T00:26:51Z I! Tags enabled: host=localhost.localdomain\r\n2017-03-29T00:26:51Z I! Agent Config: Interval:10s, Quiet:false, Hostname:\"localhost.localdomain\", Flush Interval:10s\r\n{\"fields\":{\"load1\":0,\"load15\":0.05,\"load5\":0.01,\"n_cpus\":1,\"n_users\":1},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490747220}\r\n{\"fields\":{\"uptime\":72793,\"uptime_format\":\"20:13\"},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490747220}\r\n{\"fields\":{\"load1\":0,\"load15\":0.05,\"load5\":0.01,\"n_cpus\":1,\"n_users\":1},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490747230}\r\n{\"fields\":{\"uptime\":72803,\"uptime_format\":\"20:13\"},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490747230}\r\n...\r\n$ \r\n```\r\nif, however, we uncomment the `json_timestamp_units` line in our new configuration file an set it to `1ns` as well, we will see these same timestamps output in nanoseconds instead of seconds:\r\n```bash\r\n$ ./telegraf --config telegraf-new.conf\r\n2017-03-29T00:28:52Z I! Starting Telegraf (version dev-102-g630e617)\r\n2017-03-29T00:28:52Z I! Loaded outputs: file\r\n2017-03-29T00:28:52Z I! Loaded inputs: inputs.system\r\n2017-03-29T00:28:52Z I! Tags enabled: host=localhost.localdomain\r\n2017-03-29T00:28:52Z I! Agent Config: Interval:10s, Quiet:false, Hostname:\"localhost.localdomain\", Flush Interval:10s\r\n{\"fields\":{\"load1\":0,\"load15\":0.05,\"load5\":0.01,\"n_cpus\":1,\"n_users\":1},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490747340016785814}\r\n{\"fields\":{\"uptime\":72913,\"uptime_format\":\"20:15\"},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490747340016815131}\r\n{\"fields\":{\"load1\":0,\"load15\":0.05,\"load5\":0.01,\"n_cpus\":1,\"n_users\":1},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490747350016392092}\r\n{\"fields\":{\"uptime\":72923,\"uptime_format\":\"20:15\"},\"name\":\"system\",\"tags\":{\"host\":\"localhost.localdomain\"},\"timestamp\":1490747350016446187}\r\n...\r\n$ \r\n```\r\n\r\n### Required for all PRs:\r\n\r\n- [ ] CHANGELOG.md updated (we recommend not updating this until the PR has been approved by a maintainer)\r\n- [X] Sign [CLA](https://influxdata.com/community/cla/) (if not already signed)\r\n- [ ] README.md updated (if adding a new plugin)\r\n","created_at":"2017-03-29T00:32:15Z","updated_at":"2017-03-29T01:32:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18d6ae04afdd154873e3ec7922fd91e404feed60","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/influxdata/telegraf/pulls/2587/commits","review_comments_url":"https://api.github.com/repos/influxdata/telegraf/pulls/2587/comments","review_comment_url":"https://api.github.com/repos/influxdata/telegraf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdata/telegraf/issues/2587/comments","statuses_url":"https://api.github.com/repos/influxdata/telegraf/statuses/630e617d50e8e06134543090f54ce2fddf435855","head":{"label":"tjmcs:tb/add-json-timestamp-units","ref":"tb/add-json-timestamp-units","sha":"630e617d50e8e06134543090f54ce2fddf435855","user":{"login":"tjmcs","id":1375734,"avatar_url":"https://avatars2.githubusercontent.com/u/1375734?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmcs","html_url":"https://github.com/tjmcs","followers_url":"https://api.github.com/users/tjmcs/followers","following_url":"https://api.github.com/users/tjmcs/following{/other_user}","gists_url":"https://api.github.com/users/tjmcs/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmcs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmcs/subscriptions","organizations_url":"https://api.github.com/users/tjmcs/orgs","repos_url":"https://api.github.com/users/tjmcs/repos","events_url":"https://api.github.com/users/tjmcs/events{/privacy}","received_events_url":"https://api.github.com/users/tjmcs/received_events","type":"User","site_admin":false},"repo":{"id":75512656,"name":"telegraf","full_name":"tjmcs/telegraf","owner":{"login":"tjmcs","id":1375734,"avatar_url":"https://avatars2.githubusercontent.com/u/1375734?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmcs","html_url":"https://github.com/tjmcs","followers_url":"https://api.github.com/users/tjmcs/followers","following_url":"https://api.github.com/users/tjmcs/following{/other_user}","gists_url":"https://api.github.com/users/tjmcs/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmcs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmcs/subscriptions","organizations_url":"https://api.github.com/users/tjmcs/orgs","repos_url":"https://api.github.com/users/tjmcs/repos","events_url":"https://api.github.com/users/tjmcs/events{/privacy}","received_events_url":"https://api.github.com/users/tjmcs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tjmcs/telegraf","description":"The plugin-driven server agent for collecting & reporting metrics.","fork":true,"url":"https://api.github.com/repos/tjmcs/telegraf","forks_url":"https://api.github.com/repos/tjmcs/telegraf/forks","keys_url":"https://api.github.com/repos/tjmcs/telegraf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tjmcs/telegraf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tjmcs/telegraf/teams","hooks_url":"https://api.github.com/repos/tjmcs/telegraf/hooks","issue_events_url":"https://api.github.com/repos/tjmcs/telegraf/issues/events{/number}","events_url":"https://api.github.com/repos/tjmcs/telegraf/events","assignees_url":"https://api.github.com/repos/tjmcs/telegraf/assignees{/user}","branches_url":"https://api.github.com/repos/tjmcs/telegraf/branches{/branch}","tags_url":"https://api.github.com/repos/tjmcs/telegraf/tags","blobs_url":"https://api.github.com/repos/tjmcs/telegraf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tjmcs/telegraf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tjmcs/telegraf/git/refs{/sha}","trees_url":"https://api.github.com/repos/tjmcs/telegraf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tjmcs/telegraf/statuses/{sha}","languages_url":"https://api.github.com/repos/tjmcs/telegraf/languages","stargazers_url":"https://api.github.com/repos/tjmcs/telegraf/stargazers","contributors_url":"https://api.github.com/repos/tjmcs/telegraf/contributors","subscribers_url":"https://api.github.com/repos/tjmcs/telegraf/subscribers","subscription_url":"https://api.github.com/repos/tjmcs/telegraf/subscription","commits_url":"https://api.github.com/repos/tjmcs/telegraf/commits{/sha}","git_commits_url":"https://api.github.com/repos/tjmcs/telegraf/git/commits{/sha}","comments_url":"https://api.github.com/repos/tjmcs/telegraf/comments{/number}","issue_comment_url":"https://api.github.com/repos/tjmcs/telegraf/issues/comments{/number}","contents_url":"https://api.github.com/repos/tjmcs/telegraf/contents/{+path}","compare_url":"https://api.github.com/repos/tjmcs/telegraf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tjmcs/telegraf/merges","archive_url":"https://api.github.com/repos/tjmcs/telegraf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tjmcs/telegraf/downloads","issues_url":"https://api.github.com/repos/tjmcs/telegraf/issues{/number}","pulls_url":"https://api.github.com/repos/tjmcs/telegraf/pulls{/number}","milestones_url":"https://api.github.com/repos/tjmcs/telegraf/milestones{/number}","notifications_url":"https://api.github.com/repos/tjmcs/telegraf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tjmcs/telegraf/labels{/name}","releases_url":"https://api.github.com/repos/tjmcs/telegraf/releases{/id}","deployments_url":"https://api.github.com/repos/tjmcs/telegraf/deployments","created_at":"2016-12-04T02:20:45Z","updated_at":"2016-12-04T02:20:50Z","pushed_at":"2017-03-28T23:14:12Z","git_url":"git://github.com/tjmcs/telegraf.git","ssh_url":"git@github.com:tjmcs/telegraf.git","clone_url":"https://github.com/tjmcs/telegraf.git","svn_url":"https://github.com/tjmcs/telegraf","homepage":"","size":12812,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"influxdata:master","ref":"master","sha":"9e036b2d6553b47c8d556a29b96e3b3215f4a338","user":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars1.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"repo":{"id":33258973,"name":"telegraf","full_name":"influxdata/telegraf","owner":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars1.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdata/telegraf","description":"The plugin-driven server agent for collecting & reporting metrics.","fork":false,"url":"https://api.github.com/repos/influxdata/telegraf","forks_url":"https://api.github.com/repos/influxdata/telegraf/forks","keys_url":"https://api.github.com/repos/influxdata/telegraf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdata/telegraf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdata/telegraf/teams","hooks_url":"https://api.github.com/repos/influxdata/telegraf/hooks","issue_events_url":"https://api.github.com/repos/influxdata/telegraf/issues/events{/number}","events_url":"https://api.github.com/repos/influxdata/telegraf/events","assignees_url":"https://api.github.com/repos/influxdata/telegraf/assignees{/user}","branches_url":"https://api.github.com/repos/influxdata/telegraf/branches{/branch}","tags_url":"https://api.github.com/repos/influxdata/telegraf/tags","blobs_url":"https://api.github.com/repos/influxdata/telegraf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdata/telegraf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdata/telegraf/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdata/telegraf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdata/telegraf/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdata/telegraf/languages","stargazers_url":"https://api.github.com/repos/influxdata/telegraf/stargazers","contributors_url":"https://api.github.com/repos/influxdata/telegraf/contributors","subscribers_url":"https://api.github.com/repos/influxdata/telegraf/subscribers","subscription_url":"https://api.github.com/repos/influxdata/telegraf/subscription","commits_url":"https://api.github.com/repos/influxdata/telegraf/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdata/telegraf/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdata/telegraf/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdata/telegraf/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdata/telegraf/contents/{+path}","compare_url":"https://api.github.com/repos/influxdata/telegraf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdata/telegraf/merges","archive_url":"https://api.github.com/repos/influxdata/telegraf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdata/telegraf/downloads","issues_url":"https://api.github.com/repos/influxdata/telegraf/issues{/number}","pulls_url":"https://api.github.com/repos/influxdata/telegraf/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdata/telegraf/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdata/telegraf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdata/telegraf/labels{/name}","releases_url":"https://api.github.com/repos/influxdata/telegraf/releases{/id}","deployments_url":"https://api.github.com/repos/influxdata/telegraf/deployments","created_at":"2015-04-01T16:28:44Z","updated_at":"2017-03-28T10:53:22Z","pushed_at":"2017-03-29T00:32:16Z","git_url":"git://github.com/influxdata/telegraf.git","ssh_url":"git@github.com:influxdata/telegraf.git","clone_url":"https://github.com/influxdata/telegraf.git","svn_url":"https://github.com/influxdata/telegraf","homepage":"","size":12928,"stargazers_count":2651,"watchers_count":2651,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":939,"mirror_url":null,"open_issues_count":357,"forks":939,"open_issues":357,"watchers":2651,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/2587"},"html":{"href":"https://github.com/influxdata/telegraf/pull/2587"},"issue":{"href":"https://api.github.com/repos/influxdata/telegraf/issues/2587"},"comments":{"href":"https://api.github.com/repos/influxdata/telegraf/issues/2587/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/2587/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/2587/commits"},"statuses":{"href":"https://api.github.com/repos/influxdata/telegraf/statuses/630e617d50e8e06134543090f54ce2fddf435855"}}}}
{"actor":{"display_login":"danielnelson"}}