New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

juttle-influx-adapter

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

juttle-influx-adapter

Juttle adapter for InfluxDB

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
4
Weekly downloads
 
Created
Source

Juttle InfluxDB Adapter

Build Status

InfluxDB adapter for the Juttle data flow language, with read & write support.

Currently supports InfluxDB 0.9.

Examples

Read entries from the cpu measurement where the host tag is www123 and the default limit of 1000:

read influx -db 'test' -measurements 'cpu' host='www123' | view logger

Perform an equivalent query using the -raw option:

read influx -db 'test' -raw "SELECT * FROM cpu where host='www123 LIMIT 1000' | view logger

Write a single point into the cpu measurement:

emit -points [{ value: 0.01, host: 'www123' }] | write influx -db 'test' -measurement 'cpu'

Installation

Like Juttle itself, the adapter is installed as a npm package. Both Juttle and the adapter need to be installed side-by-side:

$ npm install juttle
$ npm install juttle-influx-adapter

Configuration

The adapter needs to be registered and configured so that it can be used from within Juttle. To do so, add the following to your ~/.juttle/config.json file:

{
    "adapters": {
        "influx": {
            "url": "http://localhost:8086/"
        }
    }
}

The URL in the url key should point to the API url of your InfluxDB instance.

Authentication

Influx adapter supports HTTP basic authentication. To use it, modify the url key to include the username and password:

{
    "adapters": {
        "influx": {
            "url": "http://username:password@localhost:8086/"
        }
    }
}

Usage

Read options

When reading data, most of the InfluxQL SELECT syntax is expressible through Juttle filter expressions.

Alternatively, raw queries are also available as a fallback.

NameTypeRequiredDescription
dbstringyesdatabase to use
rawstringnosend a raw InfluxQL query to InfluxDB
measurementsarraynomeasurements to query, defaults to all measurements
offsetintegernorecord offset
limitintegernoquery limit, defaults to 1000 records
measurementFieldstringnoif specified, measurement name will be saved in a point field with this name
frommomentnoselect points after this time (inclusive)
tomomentnoselect points before this time (exclusive)

Write options

NameTypeRequiredDescription
dbstringyesdatabase to use
intFieldsarraynolists fields to be stored as integers instead of floats (default: none)
valFieldsarraynolists fields to be stored as values instead of tags (default: all non-string fields)
measurementstringyesmeasurement to use (required; optional if points contain measurement field as specified by the measurementField option)
measurementFieldstringnopoints will be checked for this field and its value will be used as the measurement name

Note: when storing points, the following conventions are used:

  1. All fields whose values are strings are treated as tags. and all fields with numeric types are treated as fields. You can override this behavior using the valueFields option. For example, ... | write influx -valueFields 'foo', 'bar' will treat foo and bar as fields, not tags.

  2. InfluxDB distinguishes between integers and floating point numeric types. By default, the adapter stores all numeric fields as floats. This can be changed by enumerating integer fields via intFields option.

Contributing

Want to contribute? Awesome! Don’t hesitate to file an issue or open a pull request.

Keywords

FAQs

Package last updated on 20 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc