package main import ( //"fmt" //"time" //"strconv" //"math/rand" . "git.wecise.com/wecise/odbserver/odb" "git.wecise.com/wecise/odbserver/odb/test" "gitee.com/wecisecode/util/logger" ) // CGO_ENABLED=1 go run --ldflags '-linkmode external -extldflags "-static"' testinsert.go // #cgo LDFLAGS: -L/opt/odbserver/sqlite -lsqlite -ldl // #include "/opt/odbserver/sqlite/sqlite.h" // #include // #include // extern int64_t uhaha_seed; // extern int64_t uhaha_ts; // void uhaha_begin_reader(); // void uhaha_end_reader(); func main() { //options := map[string]interface{} {"cache":odb.CacheAll} //g,err:= odb.New( options ) //option := &StoreOption{Cache:CacheAll} option := &Option{Cache: CacheAll, Keyspace: "ooootest", DisableInitialHostLookup: true, DisableNotify: true} g, err := test.NewG(option) if err != nil { logger.Error(err.Error()) } else { defer g.Close() } //logger.SetRollingDaily("C:/test/zkcron/src/test", "test.log") logger.SetConsole(true) //logger.SetLevel(logger.DEBUG) //rst,meta,err := g.Query(`insert into /matrix/system/policy name = 'test', domain = 'cmd', innername = 'test', branch = 'test', version = '1.1', policy = {"args":"","bin":"test.sh","cron":"0/1 * * * * * *","dir":"test-1.1","rule":"/matrix/rules/test"}, tags = ["test"]`) //rst,meta,err := g.Query(`insert into /matrix/testgroup g1='g1' , g2='g2' , g3={"bank":"tag1","core":"tag2"} , v1=1 , v2=2 , f1=1.1 , f2=1.2`) //rst,meta,err := g.Query(`insert into /matrix/entity/router id="router:12345", contain=["oracle:wwwwww"]`) // SELECT contain FROM /matrix/entity/biz where id="biz:数字国网" //rst,meta,err := g.Query(`insert into /matrix/entity/biz id="biz:数字国网",name="biz:数字国网",ip="10.216.202.70",host="数字国网",company="nxgd",contain=[{"id":"app:tomcat-app1","intp":1,"floatp":3.4},{"id":"app:tomcat-app2", "strp":"strstr"},{"id":"app:tomcat-app3"]}`) //rst,meta,err := g.Query(`insert into /matrix/entity/biz id="biz:数字国网",name="biz:数字国网", ip="10.216.202.70",host="数字国网",company="nxgd",contain=[{"id":"app:tomcat-app1","intp":1,"floatp":3.4},{"id":"app:tomcat-app2", "strp":"strstr", "roles":["admin", "users"]},{"id":"app:tomcat-app3","thrd":[5,10]}]`) //rst,meta,err := g.Query(`insert into /matrix/entity/biz id="biz:数字国网",name="biz:数字国网",ip="10.216.202.70",hostname="数字国网",company="nxgd",contain=["app:tomcat-app1","app:tomcat-app2","app:tomcat-app3"]`) //rst,meta,err := g.Query(` insert into /matrix/devops/event/realtime_alert (name,severity,ctime) values ('aaa',5,'2020-03-18 12:21:12');`) /*for i:=1234567890 ; i<1234567890+10 ; i++ { rst,meta,err := g.Query( fmt.Sprintf(` insert into /matrix/testbucket4 (id, bkdata[ 'iparam1', 'iparam2', 'fparam1', 'fparam2', 'sparam1', 'vparam1']) values ('linux:wecise', [1, nil, 3.3, 6.5, '%d', 'abcdefghhhhh'] ) at '2020-07-24 10:24:16'`, i)) if err != nil { logger.Info("Query error:"+err.Error()) logger.Warn(meta["type"]) }else{ logger.Info("rst ===>", rst) //logger.Error("meta ===>", meta) if meta["trace"] != nil && len(meta["trace"].([]string)) > 0 { for _, msg := range meta["trace"].([]string) { logger.Error(msg) } } logger.Warn(meta["columns"]) } }*/ //rst,meta,err := g.Query(`insert into /matrix/entity/hmc (id, config, host, name) values ("hmc:node3", {"list":"/testorg0"}, "wecise", "唯简")`) //rst,meta,err := g.Query(`insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '作业控制台', null, null, '2020-04-21', null, 'Job', {'group':'application'}, 'job.png', '8814723100569440912', '作业控制台', null, null, 742, 0, 0, null, '_parent', '/matrix/job', '2020-04-21')`) //rst,meta,err := g.Query(`INSERT into /matrix/entity/interface (id, interface_perf) values ("interface:RWU9451-900439-1_X2",["121.136.24.126",4.05345935041445,1.28524571646452,"x2"]) at "2020-12-06 18:14:30";`) //rst,meta,err := g.Query(`insert into /matrix/portal/tools (app, belongto, class, cnname, connect, contain, day, depend, enname, fail, groups, icon, name, refer, runon, seat, selected, status, success, tags, target, url, vtime) values ('', null, '/matrix/portal/tools', '对象管理', null, null, '2021-01-22', null, 'OMDB', null, {'group':'system'}, 'omdb.png', '对象管理', null, null, 316, 0, 0, null, null, '_parent', '/matrix/omdb', 1611280343479)`) //rst,meta,err := g.Query(`insert into /matrix/entity/itm (id, disk_perf) values ('itm:node3', ["/opt",5,5.5,5,5]) at ""`) /* rst,meta,err := g.Query(` insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '作业控制台', null, null, '2020-04-21', null, 'Job', {'group':'application'}, 'job.png', '8814723100569440912', '作业控制台', null, null, 742, 0, 0, null, '_parent', '/matrix/job', 1587429719340); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '事件控制台', null, null, '2020-04-21', null, 'Event', {'group':'application'}, 'event.png', '729969318835110277', '事件控制台', null, null, 742, 0, 0, null, '_parent', '/matrix/event', 1587429714557); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '性能管理', null, null, '2020-04-21', null, 'Performance', {'group':'application'}, 'performance.png', '6626348897731864077', '性能管理', null, null, 742, 0, 0, null, '_parent', '/matrix/performance', 1587429737986); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '服务面板', null, null, '2020-04-22', null, 'Summary', {'group':'system'}, 'summary.png', '4323757888248230414', '服务面板', null, null, 753, 0, 0, null, '_parent', '/matrix/summary', 1587539721889); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '实体管理', null, null, '2020-04-21', null, 'Entity', {'group':'system'}, 'cmdb.png', '3688202906988096307', '实体管理', null, null, 742, 0, 0, null, '_parent', '/matrix/entity', 1587429728283); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '探针管理', null, null, '2020-04-21', null, 'Probe', {'group':'application'}, 'probe.png', '18054631475080762941', '探针管理', null, null, 742, 0, 0, null, '_parent', '/matrix/probe', 1587429748533); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '配置管理', null, null, '2020-04-21', null, 'Config', {'group':'system'}, 'config.png', '16189993373364741387', '配置管理', null, null, 742, 0, 0, null, '_parent', '/matrix/config', 1587429765684); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '创作中心', null, null, '2020-04-21', null, 'Creative', {'group':'system'}, 'creative.png', '15919268718129958720', '创作中心', null, null, 742, 0, 0, null, '_parent', '/matrix/creative', 1587429724251); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '拓扑管理', null, null, '2020-04-21', null, 'Topological', {'group':'application'}, 'topological.png', '15604217246982015482', '拓扑管理', null, null, 742, 0, 0, null, '_parent', '/matrix/topological', 1587429743828); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', 'AI', null, null, '2020-04-21', null, 'AI', {'group':'system'}, 'ai.png', '14571201506270844621', 'AI', null, null, 742, 0, 0, null, '_parent', '/matrix/ai', 1587429770100); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '接口管理', null, null, '2020-04-21', null, 'API', {'group':'system'}, 'api.png', '14236690317582057583', '接口管理', null, null, 742, 0, 0, null, '_parent', '/matrix/api', 1587429752597); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '对象管理', null, null, '2020-04-21', null, 'OMDB', {'group':'system'}, 'omdb.png', '12822081807082780277', '对象管理', null, null, 742, 0, 0, null, '_parent', '/matrix/omdb', 1587429732563); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '系统管理', null, null, '2020-04-21', null, 'System', {'group':'system'}, 'system.png', '1235630703358807193', '系统管理', null, null, 742, 0, 0, null, '_parent', '/matrix/system', 1587429761592); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '我的文档', null, null, '2020-04-22', null, 'Notes', {'group':'system'}, 'notes.png', '12071602268450073202', '我的文档', null, null, 753, 0, 0, null, '_parent', '/matrix/notes', 1587539869396); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '类设计器', null, null, '2020-04-22', null, 'ClassDesign', {'group':'system'}, 'class.png', '10874969328088167307', '类设计器', null, null, 753, 0, 0, null, '_parent', '/matrix/classDesign', 1587539879365); insert into /matrix/portal/tools (class, cnname, connect, contain, day, depend, enname, groups, icon, id, name, refer, runon, seat, selected, status, tags, target, url, vtime) values ('/matrix/portal/tools', '日志管理', null, null, '2020-04-21', null, 'Log', {'group':'system'}, 'log.png', '10274964635279100928', '日志管理', null, null, 742, 0, 0, null, '_parent', '/matrix/log', 1587429757116); insert into /matrix/system/subscribe (apps, name, source, status, subject, title, users) values ('matrix', '词频预警', 'AI', 0, 'CPYJ', '词频预警', 'admin'); insert into /matrix/system/subscribe (apps, name, source, status, subject, title, users) values ('matrix', '基线计算分析', 'AI', 0, 'BASELINE', '基线计算分析', 'admin'); `)*/ //rst,meta,err := g.Query(`insert into /matrix/test (day,id,name,vtime) values (1123443225,'aaaa', '测试',1123443225);`) //rst,meta,err := g.Query(` insert into /matrix/testbucket6 (id, bkdata) values ('linux:wecise', [1, 2, 3.3, 6.5, 'abhh34','gjjcc'] ) at '2021-03-19 02:28:15'`) //rst,meta,err := g.Query(`insert into /matrix/test/collect (v_varchar, v_map, v_list, d_list, f_list, i_list, v_set, v_type ) values ('1', {"map1": "val1", "map2":"2"}, ["list1", "list2"], ["2.15", "2.15"], ["3.16", "3.16"], ["11", "12"], ["set1", "set2"], "4" )`) //rst,meta,err := g.Query(`insert into /test/malert_status_seq (identifier,agent, node,vtime) values('222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.6','huawei mttrapd', '222.129.134.178','2023-03-06') on conflict sequence`) /*rst, meta, err := g.Query(`insert into /matrix/system/depot (command, day, depend, name, refer, remark, runon, status, tags, version, vtime) values ('tar zxvf /opt/matrix/agent/depot/matrix/toev2/toev2.tar.gz -C /opt/matrix/; ln -s /opt/matrix/agent/depot/ /opt/matrix/toev2/agent/depot; ln -s /opt/matrix/repo/matrix/ /opt/matrix/toev2/repo/matrix; (crontab -l;echo "30 7 * * * sh /opt/matrix/toev2/sbin/ythyw-auto-start-v2.sh") | crontab && crontab -l', '2022-12-27', null, 'toev2', null, '新版代理', null, 0, null, '1.0.0', 1672132329496);`) */ rst, meta, err := g.Query(`insert into /test/bucketpromdbmp (id, prommp) values ('bucketpromdbmp:wecise11', [{ '__name__':'key1.key2.key0', '__value__':2, '__timestamp__':'2022-11-28 11:24:00', 'disk':'/opt/matrix', 'CPU':'CPU1'}])`) /*rst,meta,err := g.Query(`insert into /matrix/entity/linux (id,disk_perf) values ("linux:node3",["/",30,55,58,54.31388979126818,69.16669973257089]) at '2021-04-01 23:43:05.519'; insert into /matrix/entity/linux (id,disk_perf) values ("linux:node3",["/",30,55,58,54.31388979126818,69.16669973257089]) at '2021-04-01 20:43:05.519'; insert into /matrix/entity/linux (id,disk_perf) values ("linux:node3",["/",30,55,58,54.31388979126818,69.16669973257089]) at '2021-04-01 12:43:05.519'; insert into /matrix/entity/linux (id,disk_perf) values ("linux:node3",["/",30,55,58,54.31388979126818,69.16669973257089]) at '2021-04-01 00:43:05.519';`)*/ /*rst,meta,err := g.Query(`insert into /matrix/test/bucketlog (id, bklog['file1.log']) values ('linux:wecise', ["1-1--DEBUG [CompactionExecutor:584] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-2--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-3--DEBUG [CompactionExecutor:584] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-4--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables", "1-5--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-6--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-7--WARN [Native-Transport-Requests-1] 2020-07-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key", "1-8--WARN [Native-Transport-Requests-1] 2020-07-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key", "1-9--INFO [Thread-3] 2020-07-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields", "1-10--INFO [Thread-8] 2020-07-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])`)*/ /*rst,meta,err := g.Query(` insert into /matrix/test/bucketlog (id, bklog['file1.log']) values ('linux:wecise', [['[2021-06-16 00:00:00.608072][22264][2419] Level 0 : ----------------------------------------------------------- 报文放置时间:[2021-06-16 00:00:00.560000] 报文读取时间:[2021-06-15 23:59:59.930309] 处理报文时间:[2021-06-16 00:00:00.574163] 处理报文耗时:[33.876000]ms 接收报文: {H:01102100099996IBPS0000 IBPS20210616000000XMLmaps.305.001.01 00200000000755039990002000000007550399903U XN} 10210009999620210616717778362021-06-16T00:00:0010210009999600001021000999961021000999962021061573825160maps.301.001.01622202100111589127418701506942MEQCIB5I003cIktpaEuvgZD3rUwVciJEA8wT3T32UOEsiOPvAiAJSO/Hb66S3djGa3BV8Uw/A2oSG/CWJB/EO8xjFVnN9g== 处理结果: ** IB1I0000[处理成功!] ** [2021-06-16 00:00:00.641788][22264][1989] Level 0 : ----------------------------------------------------------- 报文放置时间:[2021-06-16 00:00:00.560000] 报文读取时间:[2021-06-16 00:00:00.608745] 处理报文时间:[2021-06-16 00:00:00.611142] 处理报文耗时:[30.622000]ms 接收报文: {H:01102100099996IBPS0000 IBPS20210616000000XMLmaps.305.001.01 00250000000754136018002500000007541360183U XN} 10210009999620210616857843662021-06-16T00:00:0010210009999600001021000999961021000999962021061589128394maps.301.001.01621225420000288016315584466023MEQCIHKi86xIMVUIG49/yJWagOZURxNXrtKsOaTVQJ1COXjLAiA0b9rvuS1sevfw0UlRw9zReAwJGwuUDuntSHJ0lj0HSA== 处理结果: ** IB1I0000[处理成功!] ** [2021-06-17 00:00:00.672518][22264][2025] Level 0 : ----------------------------------------------------------- 报文放置时间:[2021-06-16 00:00:00.580000] 报文读取时间:[2021-06-16 00:00:00.642211] 处理报文时间:[2021-06-16 00:00:00.644378] 处理报文耗时:[28.115000]ms 接收报文: {H:01102100099996IBPS0000 IBPS20210616000000XMLmaps.305.001.01 00100000000755018043001000000007550180433U XN} 10210009999620210616717778382021-06-16T00:00:0010210009999600001021000999961021000999962021061578736719maps.301.001.01622203370000463455618092609666MEQCIBQa1SoH2A6kQTf6gHPqzgPdj1FDJkEp7mNWYw1iF2DBAiAEkYFlcGF3ZU15Rsn2BygIr8F+D7O4Kv69QxM8yHIZeQ== 处理结果: ** IB1I0000[处理成功!] ** '] ] ) with split=/\n\n/ `)*/ //rst,meta,err := g.Query(`alter class clickcount add index column MachineClass MachineClass`) //rst,meta,err := g.Query(`insert into clickcount (MachineClass) values ('MACHINING_CENTRE')`) //rst,meta,err := g.Query(`select MachineClass from clickcount where MachineClass='MACHINING_CENTRE'`) /*g.Register( "CLASS_DATA_CHANGE:/matrix/devops/change@matrix", "/matrix/devops/change", "insert" ) rst,meta,err := g.Query(` insert into /matrix/devops/change (workordernum) values ('test1')`) g.UnRegister( "CLASS_DATA_CHANGE:/matrix/devops/change@matrix", "/matrix/devops/change", "insert" )*/ /*rst,meta,err := g.Query(`insert into /matrix/devops/alert_status (acknowledged, agent, alarmtype, alertgroup, alertkey, alertsubtype, alerttype, belongto, bname, bsm_classname, bsm_identity, bsm_subidentity, businessimpact, bussinesscategory, causetype, ccpc, ccpcbank, ciid, cmdbenrichstatus, cname, cnsummary, connect, contact, contactman, contactphone, contain, corrscore, customer, day, depend, deploy, devicelocation, devicemodel, devicepurpose, devicetype, dim, domaingroup, domainsubgroup, duration, emailstatus, entity, eventclass, eventid, eventstatus, eventtime, eventtype, evtproccode, expiretime, explain, extendedattr, fail, firstoccurrence, flag, flash, grade, id, identifier, idname, impactflag, install, instance, internallast, lastoccurrence, linux, localnodealias, localobjrelate, localpriobj, localrootobj, localsecobj, localtertobj, location, logticket, lpar, machineid, maintainstatus, maintenance, manager, market, monitor, msg_id, n_maintenance_status, name, netype, nmoscausetype, nmosdomainname, nmosentityid, nmoseventmap, nmosmanagedstatus, nmosobjinst, nmosserial, node, nodealias, nodename, nodetype, objectfullname, oldrow, omni_class, omni_serial, orgcode, originalseverity, ownergid, owneruid, phone, physicalcabinet, physicalcard, physicallocation, physicalport, physicalslot, plateng, platform, poll, probesubsecondid, processreq, recordtime, refer, region, relate, remotenodealias, remoteobjrelate, remotepriobj, remoterootobj, remotesecobj, remotetertobj, resolve, rowserial, runon, sendto, servername, serverserial, service, servicenowerrorcode, servicenowstate, servicenowsysid, severity, siteid, smsflag, statechange, status, submodel, subsystem, success, summary, suppressescl, syscode, sysplex, tags, tally, tasklist, ticketstatus, tiggerflag, tsrmflag, ttnumber, ttstate, ttuser, type, upgradeflag, url, vtime, wheel, wwheel, x733corrnotif, x733eventtype, x733probablecause, x733specificprob) values (0, '', '', '', '', 'Network', '', null, '', '', '', '', 0, '支行网络设备', 0, 0, '', '', 0, '辽阳路支行联通路由器', '', null, '', '路峰', '17663981994', null, 0, '', '2021-11-11', null, null, 'NULL', '', '', '', null, '', '', 0, 0, '', '', '', 0, '', 0, '', 0, '', '', null, 1614937870000, 0, 0, 0, '9994164945157663146', '10.16.144.111', '', 0, null, '', -6795364578871, 1614937870000, null, '', 0, '', '', '', '', 'NULL', 0, '', '', 0, 0, 'syslog', '', null, '', 0, '9994164945157663146', '', 0, '', 0, '', 0, 0, '', '10.16.144.11', '网络设备ping状态检测__级别红色', '', '', '', 0, '', 2195076, '', 5, 0, 0, '', '', '', '', 0, 0, '', '', 0, 0, 0, 0, null, '', null, '', 0, '', '', '', '', '', 0, null, null, 'NCOMS', 2195076, '', 0, 0, '', 5, '', 0, 1614937872000, 20, '', '', null, ' 网络设备ping状态检测__级别红色 10.16.144.11 03月05日17时51分08秒检测到10.16.144.11[liaoyangluZH_msr01]PING状态触发告警,当前PING状态是OFF。', 0, '', '', null, 1, 0, '', 0, 0, '', 0, '', 1, 0, '', 1636620464912, null, null, '', 0, 0, '');`)*/ //rst,meta,err :=g.Query(`insert into /matrix/test/basic (id, name) values ('8056570966701428612', 'hello') on conflict update v_int=v_int+1 `) /*rst,meta,err :=g.Query(` insert into /test/bucketlog (id, bklog['file1.log']) values ('linux:wecise', ["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key 1-9--INFO [Thread-3] 2020-06-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields 1-10--INFO [Thread-8] 2020-06-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])`) `)*/ //g.Query(` insert into /matrix/testbucket6 (id, bkdata) values ('linux:wecise', [1, 3, 3.3, 6.5, 'abhh34','gjjcc'] ) at '2021-03-19 02:28:15'`) //insert into /matrix/entity/interface (id,interface_perf) values ('interface:RWU2216-2210-1_Port 3/8#node:RWU2216-2210-1', ['192.168.0.1',2.1,3.2,'Port 3']) at '2021-03-20 10:00:00' //rst,meta,err := g.Query(` insert into /matrix/perms/api (name, pprefix, pmatch, mtime, _group) values ('测试API权限', null, ["/script/temp/test/testperm.js"], 1593306396000, ["测试组"])`) //rst,meta,err := g.Query(` insert into /matrix/testbucket4 (id, bk2) values ('linux:wecise', [ [23, nil, 3.4, 6.68, '这是ggggg'], [33, nil, 3.4, 6.69, '这是ggggg4444'] ] ) at '2020-06-14 07:'`) //rst,meta,err := g.Query(` insert into /matrix/entity/it/it_linux (id,disk) values ("it_linux:192.168.190.174",["/",49,59,56,71.81841478366437,72.47003275260354]) at '2020-05-30 20:30:03.631'`) //rst,meta,err := g.Query(`insert into /test/donghuan/c (id,values) values ('192.168.174.231', [452,24.6,572,1024,75.4]) at '2020-05-20 00:40:00'`) //rst,meta,err := g.Query(` insert into /matrix/testbucket4 (id, host) values ('linux:wecise', 'wecise2' ) `) /* for i:=0 ; i<20 ;i++{ rst,meta,err := g.Query(`insert into /matrix/entity/it/it_aix (id,disk_test) values ("it_aix:192.168.190.175",["2020-07-27 18:09:54.541","020-07-27","2020-07-27 18:09:54.541","020-07-27 18","020-07-27 18:09","020-07-27 18:09:54"]) at '2020-07-27 18:09:54.541'`) if err != nil { logger.Info("Query error:"+err.Error()) logger.Warn(meta["type"]) }else{ logger.Info("rst ===>", rst) //logger.Error("meta ===>", meta) if meta["trace"] != nil && len(meta["trace"].([]string)) > 0 { for _, msg := range meta["trace"].([]string) { logger.Error(msg) } } logger.Warn(meta["columns"]) } } */ //rst,meta,err := g.Query(` insert into /test/donghuan/a (id, values['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20']) values ('ID906', [906,906,906,906,906,906,906,906,906,906,906,906,906,906,906,906,906,906,906,906]) at '2020-05-08 14:55:51'`) //rst,meta,err := g.Query(`insert into /matrix/entity/it/it_aix (id,logs2["aaa.log"]) values ('it_aix:192.168.190.175',["Aug 9 16:23:13 aaaabbbccc dddsss sss"]);`) //rst,meta,err := g.Query(` insert into /matrix/testbucket5 (id, host) values ('linux:wecise', 'wecise') `) /*rst,meta,err := g.Query(` insert into /matrix/testbucket5 (id, bklog['file1.log']) values ('linux:wecise', ["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-4--DEBUG [CompactionExecutor:583] 2020-06-2500:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key 1-9--INFO [Thread-3] 2020-06-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields 1-10--INFO [Thread-8] 2020-06-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])`)*/ /* for _, k:= range []int{23, 24, 25, 26}{ for j:=10 ;j<24 ;j++{ for i:=10; i<60 ;i++ { for m:=10; m<60 ;m++ { rst,meta,err := g.Query(fmt.Sprintf(` insert into /matrix/testbucket5 (id, bklog['file1.log']) values ('linux:wecise', ["1-1--DEBUG [CompactionExecutor:584] 2020-06-%d %d:%d:%d,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-2--DEBUG [CompactionExecutor:583] 2020-06-%d %d:%d:%d,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-3--DEBUG [CompactionExecutor:584] 2020-06-%d %d:%d:%d,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-4--DEBUG [CompactionExecutor:583] 2020-06-%d %d:%d:%d,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables 1-5--DEBUG [CompactionExecutor:583] 2020-06-%d %d:%d:%d,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-6--DEBUG [CompactionExecutor:583] 2020-06-%d %d:%d:%d,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 1-7--WARN [Native-Transport-Requests-1] 2020-06-%d %d:%d:%d,043 SelectStatement.java:429 - Aggregation query used without partition key 1-8--WARN [Native-Transport-Requests-1] 2020-06-%d %d:%d:%d,072 SelectStatement.java:429 - Aggregation query used without partition key 1-9--INFO [Thread-3] 2020-06-%d %d:%d:%d,837 IndexMatrixSchema.java:143 - [object] No need to add fields 1-10--INFO [Thread-8] 2020-06-%d %d:%d:%d,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])`, k,j,i,m, k,j,i,m, k,j,i,m, k,j,i,m, k,j,i,m, k,j,i,m, k,j,i,m, k,j,i,m, k,j,i,m, k,j,i,m)) if err != nil { logger.Info("Query error:"+err.Error()) logger.Warn(meta["type"]) }else{ logger.Info("rst ===>", rst) //logger.Error("meta ===>", meta) if meta["trace"] != nil && len(meta["trace"].([]string)) > 0 { for _, msg := range meta["trace"].([]string) { logger.Error(msg) } } logger.Warn(meta["columns"]) } } } } } */ /* rst,meta,err := g.Query(` insert into /matrix/testbucket5 (id, bk2['file1.log']) values ('linux:wecise', ["2-1--DEBUG [CompactionExecutor:584] 2020-05-15 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 2-2--DEBUG [CompactionExecutor:583] 2020-05-15 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 2-3--DEBUG [CompactionExecutor:584] 2020-05-15 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 2-4--DEBUG [CompactionExecutor:583] 2020-05-15 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables 2-5--DEBUG [CompactionExecutor:583] 2020-05-15 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 2-6--DEBUG [CompactionExecutor:583] 2020-05-15 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 2-7--WARN [Native-Transport-Requests-1] 2020-05-15 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key 2-8--WARN [Native-Transport-Requests-1] 2020-05-15 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key 2-9--INFO [Thread-3] 2020-05-15 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields 2-10--INFO [Thread-8] 2020-05-15 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])`) */ /* rst,meta,err := g.Query(` insert into /matrix/testbucket5 (id, bk2['file2.log']) values ('linux:wecise', ["3-1--DEBUG [CompactionExecutor:584] 2020-05-16 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 3-2--DEBUG [CompactionExecutor:583] 2020-05-16 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 3-3--DEBUG [CompactionExecutor:584] 2020-05-16 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 3-4--DEBUG [CompactionExecutor:583] 2020-05-16 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables 3-5--DEBUG [CompactionExecutor:583] 2020-05-16 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 3-6--DEBUG [CompactionExecutor:583] 2020-05-16 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 3-7--WARN [Native-Transport-Requests-1] 2020-05-16 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key 3-8--WARN [Native-Transport-Requests-1] 2020-05-16 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key 3-9--INFO [Thread-3] 2020-05-16 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields 3-10--INFO [Thread-8] 2020-05-16 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])`)*/ /* rst,meta,err := g.Query(` insert into /matrix/testbucket7/subbk (id, bk2['file2.log']) values ('linux:wecise', ["3-1--DEBUG [CompactionExecutor:584] 05-16 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 3-2--DEBUG [CompactionExecutor:583] 05-16 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 3-3--DEBUG [CompactionExecutor:584] 05-16 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 3-4--DEBUG [CompactionExecutor:583] 05-16 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables 3-5--DEBUG [CompactionExecutor:583] 05-16 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 3-6--DEBUG [CompactionExecutor:583] 05-16 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 3-7--WARN [Native-Transport-Requests-1] 05-16 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key 3-8--WARN [Native-Transport-Requests-1] 05-16 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key 3-9--INFO [Thread-3] 05-16 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields 3-10--INFO [Thread-8] 05-16 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])`)*/ //rst,meta,err := g.Query(`insert into /matrix/entity/itm (id,logs["/home/matrix/logs/ncolog-20200426"]) values ("itm:test",["16.0.65.54 2020 hostname"])`) /* rst,meta,err := g.Query(` insert into /matrix/testbucket5 (id, bk2['file1.log']) values ('linux:wecise', [" 4-1--DEBUG [CompactionExecutor:584] 2020-05-17 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 4-2--DEBUG [CompactionExecutor:583] 2020-05-17 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 4-3--DEBUG [CompactionExecutor:584] 2020-05-17 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 4-4--DEBUG [CompactionExecutor:583] 2020-05-17 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables 4-5--DEBUG [CompactionExecutor:583] 2020-05-17 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 4-6--DEBUG [CompactionExecutor:583] 2020-05-17 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables 4-7--WARN [Native-Transport-Requests-1] 2020-05-17 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key 4-8--WARN [Native-Transport-Requests-1] 2020-05-17 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key 4-9--INFO [Thread-3] 2020-05-17 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields 4-10--INFO [Thread-8] 2020-05-17 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])`)*/ /*rst,meta,err := g.Query(` insert into /matrix/testbucket5 (id, bk2['file1.log']) values ('linux:wecise', ["DEBUG [CompactionExecutor:584] 2020-05-18 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables DEBUG [CompactionExecutor:583] 2020-05-18 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables DEBUG [CompactionExecutor:584] 2020-05-18 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables DEBUG [CompactionExecutor:583] 2020-05-18 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables DEBUG [CompactionExecutor:583] 2020-05-18 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables DEBUG [CompactionExecutor:583] 2020-05-18 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables WARN [Native-Transport-Requests-1] 2020-05-18 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key WARN [Native-Transport-Requests-1] 2020-05-18 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key INFO [Thread-3] 2020-05-18 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields INFO [Thread-8] 2020-05-18 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields WARN [Native-Transport-Requests-2] 2020-05-18 00:50:14,231 SelectStatement.java:429 - Aggregation query used without partition key WARN [Native-Transport-Requests-2] 2020-05-18 00:50:31,326 SelectStatement.java:429 - Aggregation query used without partition key WARN [Native-Transport-Requests-1] 2020-05-18 00:50:34,163 SelectStatement.java:429 - Aggregation query used without partition key WARN [Native-Transport-Requests-1] 2020-05-18 00:50:44,342 SelectStatement.java:429 - Aggregation query used without partition key"])`)*/ //rst,meta,err := g.Query(` insert into /matrix/testbucket4 (id, host) values ('linux:wecise','wecise') `) /*for _, k:= range []string{"23", "24", "25", "26", "27", "28", "29", "30"}{ for j:=0 ;j<24 ;j++{ for i:=0; i<60 ;i++ { r := rand.New(rand.NewSource(time.Now().UnixNano())) sql := fmt.Sprintf( `insert into /matrix/testbucket4 (id, bk2) values ('12935154896484640018', [%d, %d, %f, %f, '12345678'] ) at '2020-04-%s %s:14:%s'`, r.Intn(100), r.Intn(100000), r.Float32(), r.Float32(), k, strconv.Itoa(j), strconv.Itoa(i)) g.Query(sql) } } }*/ /*rst,meta,err := g.Query(` insert into /matrix/testbucket (id, bk2) values ('17515269981487313961', [2, nil, 3.5, 6.6, '1234567890'] ) at 1587514140000 `)*/ //rst,err := g.Query(`insert edge (host:测试服务器1, app:weblogic1), (host:测试服务器2, app:weblogic2) with contain`) //rst,_,err := g.Query(`insert edge from host:测试服务器1, app:weblogic1 to host:测试服务器2, app:weblogic2 with contain {this is test option}`) //rst,meta,err := g.Query(`insert into /matrix/testgroup g1='g1' , g2='g2', g3='g34' , v1=1 , v2=2 , f1=1.1 , f2=1.2`) //rst,meta,err := g.Query(`Insert into /matrix/portal/tools name='对象管理' cnname='对象管理' enname='OMDB' icon='omdb.png' seat=10 selected=0 url='/janesware/omdb'`) //rst,meta,err := g.Query(`insert into /matrix/entity/linux (id, contain) values ('linux:wecise',["app:cassandra1"])`) //rst,err := g.Query(`Insert into /matrix/flowmark/btndef script='return "hello" ',name='test',wfid=-1 `,false) if err != nil { logger.Info("Query error:" + err.Error()) logger.Warn(meta["type"]) } else { logger.Info("rst ===>", rst) //logger.Error("meta ===>", meta) if meta["trace"] != nil && len(meta["trace"].([]string)) > 0 { for _, msg := range meta["trace"].([]string) { logger.Error(msg) } } logger.Warn(meta["columns"]) } }