<?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 Re: In field extraction, how to do the matching between them and increment the result? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418931#M120428</link>
    <description>&lt;P&gt;Can you explain how the output of that search query you have so far does not match with what you want?&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jul 2018 14:12:48 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2018-07-03T14:12:48Z</dc:date>
    <item>
      <title>In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418930#M120427</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;I'm looking to have this result: &lt;BR /&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/5304i627FCE52EC4D37D7/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;For that I have 2 lines in my file: &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Question&lt;/STRONG&gt;: Service + IdTransaction&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Response&lt;/STRONG&gt;: Status + IdTransaction&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Until now i can extract the different name of service and different codes but i don't know how to do the matching between them and to increment the result. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(?&amp;lt;Service&amp;gt;CONSULT|FIN_GB|FIN_RESERVE|FIN_VENDEUR|AUTHENTIF)" 
| rex field=_raw "Tlv Dico : (?&amp;lt;new&amp;gt;.{22}.{27})?"
| rex field=new "2004(?&amp;lt;Status&amp;gt;.{5})?"
| stats count(TransactionId) by Service , Status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jul 2018 13:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418930#M120427</guid>
      <dc:creator>omarka</dc:creator>
      <dc:date>2018-07-03T13:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418931#M120428</link>
      <description>&lt;P&gt;Can you explain how the output of that search query you have so far does not match with what you want?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 14:12:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418931#M120428</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-07-03T14:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418932#M120429</link>
      <description>&lt;P&gt;Well, it tells me: No results found.  &lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 14:15:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418932#M120429</guid>
      <dc:creator>omarka</dc:creator>
      <dc:date>2018-07-03T14:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418933#M120430</link>
      <description>&lt;P&gt;Are you running just that specific search? Because I would expect there needs to be something before that, to actually search some data (ie index=foo sourcetype=bar).&lt;/P&gt;

&lt;P&gt;Also: that TransactionId field, does that exist and contain data?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 14:18:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418933#M120430</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-07-03T14:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418934#M120431</link>
      <description>&lt;P&gt;@omarka if you can add some masked/anonymized sample events, it would be easier for the community members to help you with regex as it would be strictly dependent on your data.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 14:29:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418934#M120431</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-07-03T14:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418935#M120432</link>
      <description>&lt;P&gt;No i'm running this search : &lt;CODE&gt;(host=g5d66999 OR g5d66956) &lt;BR /&gt;
Logger=srvca  TLV | rex "(?CONSULT|FIN_GB|FIN_RESERVE|FIN_VENDEUR|AUTHENTIF)" &lt;BR /&gt;
 | rex field=_raw "Tlv Dico : (?.{22}.{27})?"&lt;BR /&gt;
 | rex field=new "2004(?.{5})?"&lt;BR /&gt;
 | stats count(TransactionId) by Service , Status&lt;/CODE&gt;&lt;BR /&gt;
And yes TransactionID contains data&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 14:30:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418935#M120432</guid>
      <dc:creator>omarka</dc:creator>
      <dc:date>2018-07-03T14:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418936#M120433</link>
      <description>&lt;P&gt;TransactionID or TransactionId? Field names are case sensitive!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 14:32:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418936#M120433</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-07-03T14:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418937#M120434</link>
      <description>&lt;P&gt;Yes it is exactly TransactionId&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 14:39:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418937#M120434</guid>
      <dc:creator>omarka</dc:creator>
      <dc:date>2018-07-03T14:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418938#M120435</link>
      <description>&lt;P&gt;I'll explain how it works and what i want.&lt;BR /&gt;
I have 2 lines containing each one "TransactionId" &amp;amp; "Service" and  "TransactionId" &amp;amp; "Status", so when we find &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;401 as TransactionId and CONSULT as Service&lt;/LI&gt;
&lt;LI&gt;401 as TransactionId and 000000 as Status&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;So (for example) this is the first line in results, if we find &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;453 as TransactionId and CONSULT as Service&lt;/LI&gt;
&lt;LI&gt;453 as TransactionId and 000000 as Status&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;It will increment the first line as shown in the table at the top and so on ...&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 15:05:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418938#M120435</guid>
      <dc:creator>omarka</dc:creator>
      <dc:date>2018-07-03T15:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418939#M120436</link>
      <description>&lt;P&gt;You are getting no results because there is no event with both a &lt;CODE&gt;Status&lt;/CODE&gt; and a &lt;CODE&gt;TransactionId&lt;/CODE&gt;. You need  to roll together your two events into a single event per &lt;CODE&gt;TransactionId&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Try this... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your base search
 | rex "(?&amp;lt;Service&amp;gt;CONSULT|FIN_GB|FIN_RESERVE|FIN_VENDEUR|AUTHENTIF)" 
 | rex field=_raw "Tlv Dico : (?&amp;lt;new&amp;gt;.{22}.{27})?"
 | rex field=new "2004(?&amp;lt;Status&amp;gt;.{5})?"
 | stats values(Service) as Service values(Status) as Status by TransactionId
 | stats count(TransactionId) by Service , Status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jul 2018 15:15:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418939#M120436</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-07-03T15:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418940#M120437</link>
      <description>&lt;P&gt;Thank you @DalJeanis for your answer. &lt;BR /&gt;
However, i want to know if it's possible to switch or transpose this values by having something like that:&lt;/P&gt;

&lt;P&gt;Service                     00000                 02040              06570&lt;BR /&gt;
CONSULT                   1650                    150                      15&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 15:44:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418940#M120437</guid>
      <dc:creator>omarka</dc:creator>
      <dc:date>2018-07-03T15:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: In field extraction, how to do the matching between them and increment the result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418941#M120438</link>
      <description>&lt;P&gt;@omarka -&lt;/P&gt;

&lt;P&gt;Assuming your columns are values of &lt;CODE&gt;Status&lt;/CODE&gt;, then you are looking for the &lt;CODE&gt;chart&lt;/CODE&gt; command.  Replace the final &lt;CODE&gt;stats&lt;/CODE&gt; with... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart count(TransactionId) by Service, Status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More detail on how to use it here - &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Chart"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Chart&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 17:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-field-extraction-how-to-do-the-matching-between-them-and/m-p/418941#M120438</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-07-03T17:17:23Z</dc:date>
    </item>
  </channel>
</rss>

