{"id":72921,"date":"2023-04-25T16:04:31","date_gmt":"2023-04-25T16:04:31","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=72921"},"modified":"2023-04-25T16:04:31","modified_gmt":"2023-04-25T16:04:31","slug":"answer-by-warren-for-whats-the-best-strategy-to-monitor-splunk-log-for-missing-event-successful","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=72921","title":{"rendered":"Answer by warren for What&#8217;s the best strategy to monitor Splunk log for missing event successful?"},"content":{"rendered":"<p>Given the small sample you gave us, this should do what you&#8217;re looking for (without using <code>transaction<\/code>):<\/p>\n<pre><code>index=ndx sourcetype=srctp STR=* (MIT=&quot;Local Step started&quot; OR MIT=&quot;Copy Step successful&quot;)\n| eval status=if(match(MIT,&quot;started&quot;),&quot;begin&quot;,&quot;end&quot;)\n| stats values(status) as status by STR\n| where mvcount(status)&lt;2\n<\/code><\/pre>\n<p>What this does:<\/p>\n<ul>\n<li>only look for entries where there is a <code>STR<\/code> values, <em>and<\/em> <code>MIT<\/code> is equal to &quot;Local Step started&quot; OR &quot;Copy Step successful&quot;<\/li>\n<li>because we know <code>MIT<\/code> only ever contains &quot;Local Step started&quot; OR &quot;Copy Step successful&quot;, set <code>status<\/code> to &quot;begin&quot; if &quot;started&quot; is found, and &quot;end&quot; otherwise<\/li>\n<li><a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/stats\" rel=\"nofollow noreferrer\"><code>stats values(status)<\/code><\/a>, grouping by <code>STR<\/code><\/li>\n<li>filter all the <code>values()<\/code>&#8216;d entries by only those that have <em>one<\/em> entry (either a &quot;begin&quot; or an &quot;end&quot;)<\/li>\n<\/ul>\n<p>The result <em>should<\/em> be all <code>STR<\/code>s for which there was no successful completion<\/p>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/76066793\/whats-the-best-strategy-to-monitor-splunk-log-for-missing-event-successful\/76103248#76103248<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Given the small sample you gave us, this should do what you&#8217;re looking for (without using transaction): index=ndx sourcetype=srctp STR=* (MIT=&quot;Local Step started&quot; OR MIT=&quot;Copy Step successful&quot;) | eval status=if(match(MIT,&quot;started&quot;),&quot;begin&quot;,&quot;end&quot;) | stats values(status) as status by STR | where mvcount(status)&lt;2 What this does: only look for entries where there is a STR values, and MIT &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=72921\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for What&#8217;s the best strategy to monitor Splunk log for missing event successful?<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[991],"keyring_services":[],"class_list":["post-72921","post","type-post","status-publish","format-standard","hentry","category-blih","tag-stackexchange"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/72921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72921"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/72921\/revisions"}],"predecessor-version":[{"id":72922,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/72921\/revisions\/72922"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72921"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=72921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}