LoginSignup
3
1

More than 5 years have passed since last update.

Embulk previewの便利オプション-G

Posted at

Embulkで、カラムの数が多いデータをプレビューする場合は-Gオプションを使いましょう。

-Gを使わない出力

とても見にくいです。

embulk preview conf.yml 
2016-05-30 17:27:35.682 +0900: Embulk v0.8.9
2016-05-30 17:27:37.207 +0900 [INFO] (0001:preview): Loaded plugin embulk-input-apache-dummy-log (0.1.0)
+--------------------+-----------------------+-------------+-----------------------------+---------------+---------------------------------+-----------------+-------------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| remote_host:string | identity_check:string | user:string |          datetime:timestamp | method:string |                     path:string | protocol:string | status:long | size:long |                                                                                                                                                                       referer:string |                                                                                                                                                                                    user_agent:string |
+--------------------+-----------------------+-------------+-----------------------------+---------------+---------------------------------+-----------------+-------------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|       80.180.78.98 |                     - |           - | 2016-05-30 08:27:37.346 UTC |           GET |                /category/sports |        HTTP/1.1 |         200 |        76 |                                                                                                                                                                                    - |                                                                                                                  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 |
|      128.150.88.24 |                     - |           - | 2016-05-30 08:27:37.352 UTC |           GET |           /item/networking/1497 |        HTTP/1.1 |         200 |       104 |                                                                                                                                                                    /search/?c=Sports |                                                                                            Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7 |

-Gオプションを使うと

データを1行、1カラムで表示するのでこのようなデータでは確認がしやすいです。

embulk preview -G /tmp/conf.yml 
*************************** 1 ***************************
   remote_host (   string) : 88.60.125.96
identity_check (   string) : -
          user (   string) : -
      datetime (timestamp) : 2016-05-30 08:27:48.244 UTC
        method (   string) : GET
          path (   string) : /item/cameras/183
      protocol (   string) : HTTP/1.1
        status (     long) : 200
          size (     long) : 73
       referer (   string) : -
    user_agent (   string) : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; YTB730; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)
*************************** 2 ***************************
   remote_host (   string) : 60.210.201.133
identity_check (   string) : -
          user (   string) : -
      datetime (timestamp) : 2016-05-30 08:27:48.250 UTC
        method (   string) : GET
          path (   string) : /category/software
      protocol (   string) : HTTP/1.1
        status (     long) : 200
          size (     long) : 135
       referer (   string) : -
    user_agent (   string) : Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
*************************** 3 ***************************
   remote_host (   string) : 144.78.182.90
identity_check (   string) : -
          user (   string) : -
      datetime (timestamp) : 2016-05-30 08:27:48.253 UTC
        method (   string) : GET
          path (   string) : /category/toys
      protocol (   string) : HTTP/1.1
        status (     long) : 200
          size (     long) : 133
       referer (   string) : /item/software/3978
    user_agent (   string) : Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1

参考

3
1
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
3
1