{"id":20372619,"url":"https://github.com/txchen/influx-gateway","last_synced_at":"2025-07-05T17:09:15.880Z","repository":{"id":57273745,"uuid":"42210959","full_name":"txchen/influx-gateway","owner":"txchen","description":"write json event to influxdb","archived":false,"fork":false,"pushed_at":"2016-02-24T18:37:13.000Z","size":28,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T16:44:32.601Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/influx-gateway","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/txchen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-09T23:52:42.000Z","updated_at":"2016-02-20T06:45:34.000Z","dependencies_parsed_at":"2022-09-17T05:11:09.223Z","dependency_job_id":null,"html_url":"https://github.com/txchen/influx-gateway","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Finflux-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Finflux-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Finflux-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Finflux-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/txchen","download_url":"https://codeload.github.com/txchen/influx-gateway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241921840,"owners_count":20042763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T01:14:05.600Z","updated_at":"2025-03-04T20:42:28.022Z","avatar_url":"https://github.com/txchen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# influx-gateway\n\n[![Build Status](https://travis-ci.org/txchen/influx-gateway.svg)](https://travis-ci.org/txchen/influx-gateway)\n[![NPM version](http://img.shields.io/npm/v/influx-gateway.svg?style=flat-square)](https://www.npmjs.com/package/influx-gateway)\n[![Code Climate](https://codeclimate.com/github/txchen/influx-gateway/badges/gpa.svg)](https://codeclimate.com/github/txchen/eslint-plugin-riot)\n\nInfluxDB had a json protocol but it will be deprecated, this service helps you to write json into influxDB.\n\n## How to deploy\n\nFirstly, install:\n\n```bash\n$ npm install influx-gateway -g\n```\n\nThen command `igw` or `influx-gateway` will be available.\n\nNow we need a configuration file for influx-gateway, you can see the example by running:\n\n```bash\n$ igw genconfig\n```\n\nCreate a config file, and then we can run the server:\n\n```bash\n$ igw -c [configfile]\n```\n\n## Configuration\n\nConfig is quite straight forward. The only tricky part is: if your influxdb requires authentication, you should include the username and password in the `influx_url`.\n\n## Authentication\n\nInflux-gateway does not provide authentication, you can put a proxy in front of igw. For example, an nginx instance with basic auth check enabled.\n\n## API\n\n* GET /ping\n\nPing will check the influxdb connectivity.\n\n* POST /event\n\nThis API would transform json input into influx db's line protocol message. See [Here](https://influxdb.com/docs/v0.9/write_protocols/line.html) for more information about line-protocol.\n\nExample payload:\n\n```json\n{\n  \"_name\": \"cpu\",\n  \"__f1\": 1,\n  \"tag1\": \"v1\",\n  \"tag2\": \"v2\"\n}\n```\n\n`_name` must be specified as the measurement name, type must be string, regex: `/^[a-zA-Z0-9][\\w-\\.\\/]*$/`\n\nField name starts with `__[a-zA-Z0-9]`, and remaining part use the same rule as measurement name.\n\nField value can be number, boolean or string.\n\nFields are optional, if no fields in the payload, igw will add `count=1i` automatically.\n\nTag name and tag value also should follow the measurement name regex.\n\nTags are also optional.\n\n* POST /query\n\nThis API accepts influxdb query and returns json result. Query must start with `SELECT`.\n\nExample payload:\n\n```json\n{\n  \"q\": \"SELECT value FROM cpu_load_short WHERE region='us-west'\",\n}\n```\n\nExample result:\n\n```json\n{\n  \"latency\": 230,\n  \"series\": [\n    {\n      \"name\": \"cpu_load_short\",\n      \"columns\": [\n        \"time\",\n        \"value\"\n      ],\n      \"values\": [\n        [\n          \"2015-01-29T21:55:43.702900257Z\",\n          0.55\n        ],\n        [\n          \"2015-01-29T21:55:43.702900257Z\",\n          23422\n        ],\n        [\n          \"2015-06-11T20:46:02Z\",\n          0.64\n        ]\n      ]\n    }\n  ]\n}\n```\n\n## Changelog\n\n**2016-02-24** `0.1.5`\nAdd query latency in response.\n\n**2016-02-23** `0.1.4`\nAdd query api.\n\n**2015-10-13** `0.1.3`\nUpgrade dependencies.\n\n**2015-10-11** `0.1.2`\n1st working version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxchen%2Finflux-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftxchen%2Finflux-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxchen%2Finflux-gateway/lists"}