Skip to content

InfluxDB

Bases: Spout

__init__(output, state, **kwargs)

Initialize the InfluxDB class.

Parameters:

Name Type Description Default
output BatchOutput

An instance of the BatchOutput class for saving the data.

required
state State

An instance of the State class for maintaining the state.

required
**kwargs

Additional keyword arguments.

{}

Using geniusrise to invoke via command line

genius InfluxDB rise \
    batch \
        --output_s3_bucket my_bucket \
        --output_s3_folder s3/folder \
    none \
    fetch \
        --args host=localhost port=8086 username=myusername password=mypassword database=mydatabase

Using geniusrise to invoke via YAML file

version: "1"
spouts:
    my_influxdb_spout:
        name: "InfluxDB"
        method: "fetch"
        args:
            host: "localhost"
            port: 8086
            username: "myusername"
            password: "mypassword"
            database: "mydatabase"
        output:
            type: "batch"
            args:
                bucket: "my_bucket"
                s3_folder: "s3/folder"

fetch(host, port, username, password, database)

📖 Fetch data from an InfluxDB database and save it in batch.

Parameters:

Name Type Description Default
host str

The InfluxDB host.

required
port int

The InfluxDB port.

required
username str

The InfluxDB username.

required
password str

The InfluxDB password.

required
database str

The InfluxDB database name.

required

Raises:

Type Description
Exception

If unable to connect to the InfluxDB server or execute the query.