question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Embedding variables in config file

See original GitHub issue

In addition to #206, this idea makes it possible to embed variables in config file. Unlike #206, this idea is based on text processing. Embulk reads a config file, and apply a template engine such as ERB, and load the generated file using YAML. It also means that variables don’t have types (all variables are text).

Here is an example:

variables:  # declare variables in a config file
  myval: 1
plugin_variables:  # run an input plugin, and use the last (or first) row as variables
  type: postgresql
  query: select max(id) as max_id from access
  database: production
  host: pg_analyze

---
in:
  type: mysql
  query: select id, host, ip from access_source where ${max_id} < id
  database: production
  host: my_tran
out:
  type: postgresql
  table: access
  database: production
  host: pg_analyze

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hiroyuki-satocommented, May 13, 2022

Hello, @doctor. You can use the Liquid template engine. See the detail Using variables https://www.embulk.org/docs/built-in.html#embulk-configuration-file-format

0reactions
doctorcommented, May 13, 2022

thank you @hiroyuki-sato looking forward to use digdag.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Want to use env variables in that config file? Well, you can ...
Meet the envsubst command. With envsubst we can embed the value of environment variables inside a string that comes from the standard input....
Read more >
Variables loaded from config files - Smarty Template Engine
Variables that are loaded from the config files are referenced by enclosing them within #hash marks# , or with the smarty variable $smarty.config...
Read more >
Using variables in configuration files - IBM
Specify a variable in the bootstrap. properties file. Use a defined variable in the configuration. Use variable element in the configuration.
Read more >
Use environment variables in the configuration - Elastic
You can use environment variable references in the config file to set values that need to be configurable during deployment. To do this,...
Read more >
Using envsubst to Merge Environment Variables into Config ...
This command is available on Linux and macOC by default and it lets you template out files with ENV vars to create dynamic...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found