{"id":72,"date":"2016-06-17T18:34:21","date_gmt":"2016-06-17T15:34:21","guid":{"rendered":"https:\/\/amsd.go.ro\/wordpress\/?p=72"},"modified":"2021-09-07T11:25:23","modified_gmt":"2021-09-07T08:25:23","slug":"delete-events-from-cell-using-mquery","status":"publish","type":"post","link":"https:\/\/amsd.go.ro\/wordpress\/?p=72","title":{"rendered":"Delete Events from Cell using mquery"},"content":{"rendered":"<p>How can I delete events from my cell with the mquery command ?<\/p>\n<p><strong>mquery<\/strong> can be used with <strong>-s DELETE<\/strong> option to delete events\/data from your impact manager.<\/p>\n<p>(Replace CELLNAME with the name of your cell)<\/p>\n<p>For example if you want to delete all CLOSED PATROL_EV type events from your cell with the msg slot = test you can run the following:<\/p>\n<p>[Here Patrol_EV = the required CLASS] In gen, you can use any class using the -a switch.<\/p>\n<pre>mquery -n CELLNAME -a PATROL_EV -w 'status: == CLOSED, msg: == test ' -s DELETE<\/pre>\n<p>To delete all events from your cell for a specific date range(18th Sep 06 -&gt; 20th Sep 06) you could use:<\/p>\n<pre>mquery -n CELLNAME -a EVENT -s DELETE -w \"date: between ['20060918', '20060920']\"<\/pre>\n<p>You can specify any slots and values to narrow down your criteria.. e.g.<\/p>\n<pre>mquery -n CELLNAME -a PATROL_EV -s DELETE -w \"status: == CLOSED, severity: == OK, <\/pre>\n<pre>mc_origin: == testcell, mc_host: =='losborn.bmc.com', event_handle: == 7086\"<\/pre>\n<p>If you want to delete entries from a dynamic data table you would have to use the -d option additionally<\/p>\n<pre>mquery -n CELLNAME -a BEM_MATCH_TABLE -d -s DELETE<\/pre>\n<p>This would delete all the data from the table <em>BEM_MATCH_TABLE<\/em>.<\/p>\n<p>As the mquery should not be used for amounts of more than 1000 entries\/events you should use the -i.e. startup option of mcell to delete ALL events from your cell.<\/p>\n<p>To check the amount of events\/entries that will be deleted simply replace the DELETE by COUNT in your mquery:<\/p>\n<pre>mquery -n CELLNAME -w 'status: == CLOSED, msg: == test ' -s COUNT<\/pre>\n<p>&nbsp;<\/p>\n<h3><strong>General Command:<\/strong><\/h3>\n<pre>mquery -n YourCellName -a EventClass -w \"event_handle: ==&lt;Internal ID&gt;\" -s DELETE<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<pre>mquery -n pncell_SDCZFMSWVPBMC03 -a CORE_EVENT -w \"event_handle: == 131253\" -s DELETE<\/pre>\n<p>For more info on the mquery binary, type a <strong>mquery -h<\/strong> from the command prompt. This will show you all available slots\/class options that you can use with <strong>mquery<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How can I delete events from my cell with the mquery command ? mquery can be used with -s DELETE option to delete events\/data from your impact manager. (Replace CELLNAME with the name of your cell) For example if you [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/amsd.go.ro\/wordpress\/?p=72#more-72\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Delete Events from Cell using mquery<\/span><\/a><\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[16,13,17,10,18,12],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-technology","tag-ps_56","tag-ps_40","tag-ps_33","tag-ps_32","tag-ps_39","tag-ps_17"],"_links":{"self":[{"href":"https:\/\/amsd.go.ro\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/amsd.go.ro\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/amsd.go.ro\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/amsd.go.ro\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/amsd.go.ro\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72"}],"version-history":[{"count":1,"href":"https:\/\/amsd.go.ro\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":172,"href":"https:\/\/amsd.go.ro\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions\/172"}],"wp:attachment":[{"href":"https:\/\/amsd.go.ro\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/amsd.go.ro\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/amsd.go.ro\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}