LoginSignup
48
31

More than 5 years have passed since last update.

Embulkのコマンドヘルプまとめ

Last updated at Posted at 2015-11-10

Embulkのコマンドオプションのまとめ

Embulk v0.8.3
Usage: embulk [-vm-options] <command> [--options]
Commands:
   mkbundle   <directory>                             # create a new plugin bundle environment.
   bundle     [directory]                             # update a plugin bundle environment.
   run        <config.yml>                            # run a bulk load transaction.
   cleanup    <config.yml>                            # cleanup resume state.
   preview    <config.yml>                            # dry-run the bulk load without output and show preview.
   guess      <partial-config.yml> -o <output.yml>    # guess missing parameters to create a complete configuration file.
   gem        <install | list | help>                 # install a plugin or show installed plugins.
                                                      # plugin path is /Users/hsato/.embulk/jruby/2.2.0
   new        <category> <name>                       # generates new plugin template
   migrate    <path>                                  # modify plugin code to use the latest Embulk plugin API
   example    [path]                                  # creates an example config file and csv file to try embulk.
   selfupdate [version]                               # upgrades embulk to the latest released version or to the specified version.

VM options:
   -J-O                             Disable JVM optimizations to speed up startup time (enabled by default if command is 'run')
   -J+O                             Enable JVM optimizations to speed up throughput
   -J...                            Set JVM options (use -J-help to see available options)
   -R...                            Set JRuby options (use -R--help to see available options)

Use `<command> --help` to see description of the commands.

共通オプション

プラグインのオプション

run/preview/guess/cleanupで次のオプションを利用できます。

短いオプション 長いオプション 説明
-L --load PATH ローカルのプラグインのパスを追加します
-I --load-path PATH Rubyスクリプトのディレクトリパス($LOAD_PATH)追加
-C --classpath PATH JAVAのCLASSPATHの追加(複数の場合:で区切る)
-b --bundle BUNDLE_DIR Gemfileのディレクトリembulk mkbundleコマンドで作成したディレクトリ

ログ関連のオプション

run/preview/guess/cleanupで次のオプションを利用できます。

短いオプション 長いオプション 説明
--log PATH ログを出力するファイルのパス(未指定時標準出力)
-l --log-level LEVEL ログレベルの指定(error warn info debug or trace)
-X KEY=VALUE embulkのシステム設定

-Xで指定できるオプション

名前 説明 初期値
page_size ページサイズ 32k

各コマンドのオプション

guessコマンド

短いオプション 長いオプション 説明
-o --output PATH guess実行後の設定出力先ファイルパス
-g --guess NAME 利用するguessプラグインの名前(カンマで区切る)

run

短いオプション 長いオプション 説明
-r --resume-state PATH レジュームステートファイル出力先
-c --config-diff PATH 次回利用時の差分設定ファイル出力先
-o(非推奨) --output NAME 次回利用時の設定ファイル出力先

cleanup

短いオプション 長いオプション 説明
-r --resume-state PATH 削除するレジュームステートファイル

詳しい説明

preview

短いオプション 長いオプション 説明
-G --vertical プレビューの表示方式切り替え(縦表示)
embulk preview -G conf/embulk_load.yml
...
*************************** 1 ***************************
         queue_id (   string) : 379ED2300012
     arrived_time (timestamp) : 2014-12-31 04:02:56 UTC
   processed_time (timestamp) : 2014-12-31 04:12:09 UTC
smtp_cli_host_uid (   string) : unknown
    smtp_cli_user (   string) : xxx.xxx.xxx.xx
    envelope_from (   string) : user@example.com
      envelope_to (   string) : foo@example.com
       message_id (   string) : <1419966125.685001.1878@example.com>
           status (   string) : sent,sent,sent
         relay_to (   string) : local,local,local
       delay_time (   string) : 536
             size (   string) : 2,261
      information (   string) : delivered to command: /usr/bin/procmail
*************************** 2 ***************************

gem

コマンド 説明
list インストール済みプラグインの一覧表示
install 指定したgemファイルを導入する
help その他ヘルプ

example

embulk example PATHで指定したパスに、サンプルのCSVファイルと設定ファイル生成します。

embulk example hoge
2015-11-10 13:32:01.849 +0900: Embulk v0.7.7
Creating hoge directory...
  Creating hoge/
  Creating hoge/csv/
  Creating hoge/csv/sample_01.csv.gz
  Creating hoge/example.yml

Run following subcommands to try embulk:

   1. embulk guess hoge/example.yml -o config.yml
   2. embulk preview config.yml
   3. embulk run config.yml

selfupdate

embulk selfupdateで最新のバージョンにアップデートします。

emblk selfupdate x.y.zで指定したembulkのバージョンに入れ替えを行います。

mkbundle

embulk bundle directoryで指定したディレクトリにプラグインを格納する環境を構築します。

詳細: embulk bundle の使い方

bundle

bundlerコマンドを呼び出しします。詳細はBundlerのページをご覧ください。

new(開発用コマンド)

新しいプラグインの雛形を作ります。categoriesの中から作成するプラグインの種類を指定します。

categories:
    ruby-input                 Ruby record input plugin    (like "mysql")
    ruby-output                Ruby record output plugin   (like "mysql")
    ruby-filter                Ruby record filter plugin   (like "add-hostname")
    #ruby-file-input           Ruby file input plugin      (like "ftp")          # not implemented yet [#21]
    #ruby-file-output          Ruby file output plugin     (like "ftp")          # not implemented yet [#22]
    ruby-parser                Ruby file parser plugin     (like "csv")
    ruby-formatter             Ruby file formatter plugin  (like "csv")
    #ruby-decoder              Ruby file decoder plugin    (like "gzip")         # not implemented yet [#31]
    #ruby-encoder              Ruby file encoder plugin    (like "gzip")         # not implemented yet [#32]
    java-input                 Java record input plugin    (like "mysql")
    java-output                Java record output plugin   (like "mysql")
    java-filter                Java record filter plugin   (like "add-hostname")
    java-file-input            Java file input plugin      (like "ftp")
    java-file-output           Java file output plugin     (like "ftp")
    java-parser                Java file parser plugin     (like "csv")
    java-formatter             Java file formatter plugin  (like "csv")
    java-decoder               Java file decoder plugin    (like "gzip")
    java-encoder               Java file encoder plugin    (like "gzip")

migrate(開発用)

embulk migrate プラグインディレクトリで、指定したパスのプラグインを最新のAPIに書き換えします。

JVMのオプション

embulk -JでJVMのオプションを指定することができます。例) -J-XX:MaxRAMFraction=1

-J/path/to/configとすれば指定したファイルにJVMのオプションをまとめて記述することができます。(Windows未対応)

-Jの後には空白を入れないでください

48
31
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
48
31