TINE Docs
GitHub
  • Highlights
  • TINE
    • Install
  • GETTING STARTED
    • Quick start
    • Concept
      • Multiple Inlets and Outlets
      • Merge Records
      • Pipeline as Http Handler
    • Log config
  • Embedding TINE in Go
    • Use Recipe
    • Use API
  • Plugins
    • Inlets
    • Flows
    • Outlets
    • Extras
  • RECIPES
    • QRCode Generator
    • OLLAMA
    • OLLAMA Telegram Bot
    • Web Page Snapshot
    • Syslog Receiver
    • SQLite
    • RRD
Powered by GitBook
On this page
  • EXCEL
  • FILE
  • HTTP
  • IMAGE
  • INFLUX
  • MQTT
  • TELEGRAM
  • TEMPLATE
Edit on GitHub
  1. Plugins

Outlets

PreviousFlowsNextExtras

Last updated 9 months ago

EXCEL

Source

Config

[[outlet.excel]]
    ## Save the records into Microsoft Excel file format.
    ## File path (*.xlsx) to save the records
    path = "./output.xlsx"
    ## It stores all records in memory first then write to the file 
    ## when the count of the buffered records in memory reaches to "records_per_file".
    ## So, every excel file it writes has "records_per_file" rows. (+ 1 header row)
    ## If records_per_file is 0, it will keep all records in memory (consuming memory) 
    ## and write to the file when the pipeline is closed.
    ## (default 20000)
    records_per_file = 20000

Example

Run

Output

FILE

Config

Example

Run

Output

HTTP

Config

Example

Run

Output

IMAGE

Config

[[outlets.image]]
    ##
    # overwrite = true
    #
    ## The path to the output file.
    ## If the file exists and overwrite is false, it will be append "_"+field_name+"_"+sequence number before the extension.
    ## If the file exists and overwrite is true, it will be append "_"+field_name before the extension.
    ## supported formats: png, jpeg, gif, bmp
    path = "./output.png"
    ## fields that contains the image data
    ## if not specified, it will find all binary fields that has Content-type "image/*"
    # image_fields = ["image"]
    ## Quality of jpeg image (jpeg only)
    ## 1 ~ 100
    # jpeg_quality = 75

Example

Run

Output

INFLUX

Config

[[outlets.influx]]
    ## The name of the database to write to
    ##
    ## If the database does not exist, create first by running:
    ## curl -XPOST 'http://localhost:8086/query' --data-urlencode 'q=CREATE DATABASE "metrics"'
    ##
    db = "metrics"
    ## The URL of the InfluxDB server
    ## Or file path to write to a file
    # path = "-"
    path = "http://127.0.0.1:8086/write?db=metrics"
    ## The tags to add to the metrics
    ## If 'value' is not set, the value of the tag will be taken from the record
    tags = [
        {name="dc", value="us-east-1"},
        {name="env", value="prod"},
        {name="_in"}
    ]

    ## Write timeout, especially for the HTTP request
    timeout = "3s"
    ## Debug mode for logging the response message from the InfluxDB 
    debug = true

Example

[log]
    path = "-"
    level = "info"
[defaults]
    interval = "5s"
[[inlets.load]]
    loads = [1,5,15]
[[inlets.mem]]
[[inlets.host]]
[[flows.merge]]
    wait_limit = "5s"
    name_infix = "."
[[outlets.influx]]
    db = "metrics"
    path = "http://127.0.0.1:8086/write?db=metrics"
    tags = [
        {name="dc", value="us-east-1"},
        {name="env", value="prod"},
        {name="_in"}
    ]
    timeout = "3s"
    debug = false

MQTT

Config

[[outlets.mqtt]]
    ## mqtt server address
    server = "127.0.0.1:1883"
    ## mqtt topic to publish
    topic  = "topic_to_publish"
    ## publish QoS, supports 0, 1
    qos = 1
    ## timeout for CONN and PUBLISH (default: 3s)
    timeout = "3s"
    ## output format
    format = "csv"
    ## output fields
    fields = []
    ## output compression
    compress = ""
    ## time format (default: s)
    ##  s, ms, us, ns, Golang timeformat string")
    ##  e.g. timeformat = "2006-01-02 15:04:05 07:00"
    timeformat = "s"
    ## timezone (default: Local)
    ##  e.g. tz = "Local"
    ##  e.g. tz = "UTC"
    ##  e.g. tz = "America/New_York"
    tz = "Local"

Example

Run

Output

TELEGRAM

Config

[[outlets.telegram]]
    token = "<bot_token>"
      ## If the input record has "chat_id" INT field it will be used,
    ## otherwise the default chat_id will be used
    ## If the input record doesn't have "chat_id" field,
    ## and the default "chat_id" is not set, the record will be ignored
    chat_id = "<chat_id>"
    debug = false

Example

Run

Output

TEMPLATE

Config

[[outlets.template]]
    ## File path to write the output, "-" means stdout, "" means discard
    path = "-"
    
    ## Overwrite the file if "path" is a file and it already exists
    overwrite = false

    ## Output the data in column mode
    column_series = "json"

    ## Templates in string
    templates = [
        """{{ range . }}TS: {{ (index ._ts).Format "2006 Jan 02 15:04:05" }} INLET:{{ index ._in }} load1: {{ index .load1 }} {{ end }}\n"""
    ]
    ## Template files to load
    templateFiles = []

    ## Timezone to use for time formatting
    timeformat = "s"

    ## Timezone to use for time formatting
    tz = "Local"

    ## Decimal places for float values
    decimal = -1

Example

Run

Output

Source

Source

Source

Source

Source

Source

Source

plugins/excel
plugins/base
plugins/http
plugins/image
plugins/influx
plugins/mqtt
plugins/telegram
plugins/template