26mupdate.mql 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. insert into /test/malert_status (identifier, severity, lastoccurrence, maintenance, msg, type, agent, firstoccurrence, omni_class, nodealias, alertgroup, node, manager, originalseverity, summary, tags) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) on conflict update firstoccurrence=firstoccurrence, servicenowstate=servicenowstate, emailstatus=emailstatus, tally=tally+1
  2. /**
  3. params("xxx", 5, 1622249715000, 1, "设备:222.129.134.178电源整体功能恢复!", 1, "huawei mttrapd #1", 1622211715023, "300", "222.129.134.178", "huawei_power_func", "222.129.134.178", "MTTrapd Probe", 5, "设备:222.129.134.178电源整体功能恢复!", "xxx")
  4. **/
  5. ;
  6. select count(*) from /test/malert_status
  7. /**
  8. output()
  9. matchcount("count", 10001, 1)
  10. **/
  11. ;
  12. update /test/malert_status set summary='xxx' where identifier='xxx'
  13. /**
  14. output()
  15. **/
  16. ;
  17. select class,id,identifier,summary from /test/malert_status where identifier='xxx'
  18. /**
  19. output()
  20. matchcount(identifier, "xxx", summary, "xxx", 1)
  21. **/
  22. ;
  23. update /test/malert_status set summary='aaa' where id='9953570177941151804'
  24. /**
  25. output()
  26. **/
  27. ;
  28. select id,summary from /test/malert_status where id='9953570177941151804'
  29. /**
  30. output()
  31. matchcount(id, "9953570177941151804", summary, "aaa", 1)
  32. **/
  33. ;
  34. update /test/malert_status set summary='xxx' where id='9953570177941151804'
  35. /**
  36. output()
  37. **/
  38. ;
  39. select id,summary from /test/malert_status where id='9953570177941151804'
  40. /**
  41. output()
  42. matchcount(id, "9953570177941151804", summary, "xxx", 1)
  43. **/
  44. ;
  45. delete from /test/malert_status where identifier='xxx'
  46. /**
  47. output()
  48. **/
  49. ;
  50. select class,id,identifier,summary from /test/malert_status where identifier='xxx'
  51. /**
  52. output()
  53. count(0)
  54. **/
  55. ;
  56. select count(*) from /test/malert_status
  57. /**
  58. output()
  59. matchcount("count", 10000, 1)
  60. **/
  61. ;