{"metric":"m","tags":{"app":"a19","cluster":"c5","group":"g10","ip":"i999","zone":"z1"},"timestamp":1546272263,"value":1}
{
"job": {
"content": [
{
"reader": {
"name": "tsdbreader",
"parameter": {
"sinkDbType": "TSDB",
"endpoint": "http://localhost:8242",
"column": [
"m"
],
"splitIntervalMs": 60000,
"beginDateTime": "2019-01-01 00:00:00",
"endDateTime": "2019-01-01 01:00:00"
}
},
"writer": {
"name": "streamwriter",
"parameter": {
"encoding": "UTF-8",
"print": true
}
}
}
],
"setting": {
"speed": {
"channel": 3
}
}
}
}
m 1546272125 a1 c1 g2 i3021 z4 1.0
{ "job": { "content": [ { "reader": { "name": "tsdbreader", "parameter": { "sinkDbType": "RDB", "endpoint": "http://localhost:8242", "column": [ "__metric__", "__ts__", "app", "cluster", "group", "ip", "zone", "__value__" ], "metric": [ "m" ], "splitIntervalMs": 60000, "beginDateTime": "2019-01-01 00:00:00", "endDateTime": "2019-01-01 01:00:00" } }, "writer": { "name": "streamwriter", "parameter": { "encoding": "UTF-8", "print": true } } } ], "setting": { "speed": { "channel": 3 } } } }
{
"job": {
"content": [
{
"reader": {
"name": "tsdbreader",
"parameter": {
"sinkDbType": "RDB",
"endpoint": "http://localhost:8242",
"column": [
"__metric__",
"__ts__",
"app",
"cluster",
"group",
"ip",
"zone",
"__value__"
],
"metric": [
"m"
],
"splitIntervalMs": 60000,
"beginDateTime": "2019-01-01 00:00:00",
"endDateTime": "2019-01-01 01:00:00"
}
},
"writer": {
"name": "adswriter",
"parameter": {
"username": "******",
"password": "******",
"column": [
"`metric`",
"`ts`",
"`app`",
"`cluster`",
"`group`",
"`ip`",
"`zone`",
"`value`"
],
"url": "http://localhost:3306",
"schema": "datax_test",
"table": "datax_test",
"writeMode": "insert",
"opIndex": "0",
"batchSize": "2"
}
}
}
],
"setting": {
"speed": {
"channel": 3
}
}
}
}
{
"job": {
"content": [
{
"reader": {
"name": "tsdbreader",
"parameter": {
"sinkDbType": "RDB",
"endpoint": "http://localhost:8242",
"column": [
"__metric__",
"__ts__",
"app",
"cluster",
"group",
"ip",
"zone",
"load",
"memory",
"cpu"
],
"metric": [
"m_field"
],
"field": {
"m_field": [
"load",
"memory",
"cpu"
]
},
"splitIntervalMs": 60000,
"beginDateTime": "2019-01-01 00:00:00",
"endDateTime": "2019-01-01 01:00:00"
}
},
"writer": {
"name": "adswriter",
"parameter": {
"username": "******",
"password": "******",
"column": [
"`metric`",
"`ts`",
"`app`",
"`cluster`",
"`group`",
"`ip`",
"`zone`",
"`load`",
"`memory`",
"`cpu`"
],
"url": "http://localhost:3306",
"schema": "datax_test",
"table": "datax_test_multi_field",
"writeMode": "insert",
"opIndex": "0",
"batchSize": "2"
}
}
}
],
"setting": {
"speed": {
"channel": 3
}
}
}
}
{
"job": {
"content": [
{
"reader": {
"name": "tsdbreader",
"parameter": {
"sinkDbType": "RDB",
"endpoint": "http://localhost:8242",
"column": [
"__metric__",
"__ts__",
"app",
"cluster",
"group",
"ip",
"zone",
"__value__"
],
"metric": [
"m"
],
"tag": {
"m": {
"app": "a1",
"cluster": "c1"
}
},
"splitIntervalMs": 60000,
"beginDateTime": "2019-01-01 00:00:00",
"endDateTime": "2019-01-01 01:00:00"
}
},
"writer": {
"name": "adswriter",
"parameter": {
"username": "******",
"password": "******",
"column": [
"`metric`",
"`ts`",
"`app`",
"`cluster`",
"`group`",
"`ip`",
"`zone`",
"`value`"
],
"url": "http://localhost:3306",
"schema": "datax_test",
"table": "datax_test",
"writeMode": "insert",
"opIndex": "0",
"batchSize": "2"
}
}
}
],
"setting": {
"speed": {
"channel": 3
}
}
}
}
{
"job": {
"content": [
{
"reader": {
"name": "tsdbreader",
"parameter": {
"sinkDbType": "RDB",
"endpoint": "http://localhost:8242",
"column": [
"__metric__",
"__ts__",
"app",
"cluster",
"group",
"ip",
"zone",
"load",
"memory",
"cpu"
],
"metric": [
"m_field"
],
"field": {
"m_field": [
"load",
"memory",
"cpu"
]
},
"tag": {
"m_field": {
"ip": "i999"
}
},
"splitIntervalMs": 60000,
"beginDateTime": "2019-01-01 00:00:00",
"endDateTime": "2019-01-01 01:00:00"
}
},
"writer": {
"name": "adswriter",
"parameter": {
"username": "******",
"password": "******",
"column": [
"`metric`",
"`ts`",
"`app`",
"`cluster`",
"`group`",
"`ip`",
"`zone`",
"`load`",
"`memory`",
"`cpu`"
],
"url": "http://localhost:3306",
"schema": "datax_test",
"table": "datax_test_multi_field",
"writeMode": "insert",
"opIndex": "0",
"batchSize": "2"
}
}
}
],
"setting": {
"speed": {
"channel": 3
}
}
}
}
单值
{
"job": {
"content": [
{
"reader": {
"name": "tsdbreader",
"parameter": {
"sinkDbType": "TSDB",
"endpoint": "http://localhost:8242",
"column": [
"m"
],
"splitIntervalMs": 60000,
"beginDateTime": "2019-01-01 00:00:00",
"endDateTime": "2019-01-01 01:00:00"
}
},
"writer": {
"name": "tsdbwriter",
"parameter": {
"endpoint": "http://localhost:8240"
}
}
}
],
"setting": {
"speed": {
"channel": 3
}
}
}
}
多值
{
"job": {
"content": [
{
"reader": {
"name": "tsdbreader",
"parameter": {
"sinkDbType": "TSDB",
"endpoint": "http://localhost:8242",
"column": [
"m_field"
],
"field": {
"m_field": [
"load",
"memory",
"cpu"
]
},
"splitIntervalMs": 60000,
"beginDateTime": "2019-01-01 00:00:00",
"endDateTime": "2019-01-01 01:00:00"
}
},
"writer": {
"name": "tsdbwriter",
"parameter": {
"multiField": true,
"endpoint": "http://localhost:8240"
}
}
}
],
"setting": {
"speed": {
"channel": 3
}
}
}
}
DataX内部类型 |
TSDB数据类型 |
|
|
python datax/bin/datax.py tsdb2stream.json -j "-Xms4096m -Xmx4096m"
评论区(0)