<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do i display only events that aren't &amp;quot;backed out&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327368#M159955</link>
    <description>&lt;P&gt;I have a table of fields with items that are either a Credit or Debit  There can be multiples of the same item.  Also, an item can be "backed out" by making it a Debit.  Here's a sample:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3251i53D1D372E39DA9A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;So, "a" was credited twice and debited once.  I'd like the table to show just one "a" (along with the other rows).  Any idea how i can do this?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jul 2017 16:31:13 GMT</pubDate>
    <dc:creator>gregbo</dc:creator>
    <dc:date>2017-07-21T16:31:13Z</dc:date>
    <item>
      <title>How do i display only events that aren't "backed out"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327368#M159955</link>
      <description>&lt;P&gt;I have a table of fields with items that are either a Credit or Debit  There can be multiples of the same item.  Also, an item can be "backed out" by making it a Debit.  Here's a sample:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3251i53D1D372E39DA9A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;So, "a" was credited twice and debited once.  I'd like the table to show just one "a" (along with the other rows).  Any idea how i can do this?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 16:31:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327368#M159955</guid>
      <dc:creator>gregbo</dc:creator>
      <dc:date>2017-07-21T16:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do i display only events that aren't "backed out"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327369#M159956</link>
      <description>&lt;P&gt;You probably have to run some stats/dedup command to collapse duplicate rows. The command/function to use will depend upon what value of "C/D" you want to show. &lt;/P&gt;

&lt;P&gt;If you want to show all values of C/D for a, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving field line item C/D | stats values("C/D") as "C/D" max(line) as line by item
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you just want to show the first/last value for C/D for a&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving field line item C/D | stats first("C/D") as "C/D" first(line) as line by item
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2017 16:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327369#M159956</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-21T16:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do i display only events that aren't "backed out"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327370#M159957</link>
      <description>&lt;P&gt;@gregbo, you will have to add more details for Credit and Debit. For example if a is credited three times and Debited only once, will you have two rows for a?&lt;/P&gt;

&lt;P&gt;Based on the current question if you want to display only one row per item, you can use dedup&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;Your Base Search&amp;gt;
| dedup item
| table line item
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2017 17:01:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327370#M159957</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-21T17:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do i display only events that aren't "backed out"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327371#M159958</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval raw="1,a,C::2,j,C::3,q,C::4,a,C::5,l,C::6,a,D::7,m,C::8,r,C"
| makemv delim="::" raw
| mvexpand raw
| rename raw AS _raw
| rex "^(?&amp;lt;line&amp;gt;[^,]+),(?&amp;lt;item&amp;gt;[^,]+),(?&amp;lt;CorD&amp;gt;.*)$"

| rename COMMENT AS "Everything above generates sample events; everything below is your solution"

| stats count(eval(CorD="C")) AS Credits count(eval(CorD="D")) AS Debits BY item
| eval CorD = Credits - Debits
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Jul 2017 21:02:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327371#M159958</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-22T21:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do i display only events that aren't "backed out"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327372#M159959</link>
      <description>&lt;P&gt;That worked like a charm! Thanks Woodcock!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 14:44:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-display-only-events-that-aren-t-quot-backed-out-quot/m-p/327372#M159959</guid>
      <dc:creator>gregbo</dc:creator>
      <dc:date>2017-07-26T14:44:57Z</dc:date>
    </item>
  </channel>
</rss>

