Skip to content

Latest commit

 

History

History
39 lines (33 loc) · 1.4 KB

timestamp_offset.org

File metadata and controls

39 lines (33 loc) · 1.4 KB

Offset based Timestamp

  • Modification to JSON input plugin to provide offset based timestamps
  • This modification allows timestamp to be calculated using an offset value relative to the timestamp at time of processing
  • To configure, set json_time_format to value “offset”. Once set values, content of the json_time_key are expected to contain an offset value. Offset can be any valid go time.Duration format accepted by parseDuraton, e.g. “-100s”. Example config for telegraf.conf:
data_format = "json"
json_time_key = "timestamp"
json_time_format = "offset"

Steps to build telefraph with docker go image

Pull docker go image

docker pull golang:1.16.6-buster

clone telegraf git repo

git clone https://github.com/webx007/telegraf.git
# create new local branch of v1.19.2 release
git checkout -b mytelegraf v1.19.2

Specify go settings

create/edit docker_build.env file with build settings in the root of the telegraf src folder.

run build:

from telegraf src directory run:

mkdir ../gopkg
docker run -it -v "$PWD":/usr/src/myapp -v "$PWD"/../gopkg:/go/pkg --env-file docker_build.env -w /usr/src/myapp golang:1.16 make

Examples

Basic telegraf config for timestamp offsets, see telegraf.conf

Dockerfile to build new telegraf image, see Dockerfile