<?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: Regex in transaction endswith in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638934#M221397</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;Sorry that the host field is the log source host, to make sure we're looking at logs come from the same host.&lt;/P&gt;&lt;P&gt;It's strange that if the 2 lines match the criteria:&lt;/P&gt;&lt;P&gt;* client, host value&lt;/P&gt;&lt;P&gt;&amp;nbsp;* startswith contains cli&lt;/P&gt;&lt;P&gt;* endswith contains says&lt;/P&gt;&lt;P&gt;but always can't be 'grouped' by transaction.&lt;/P&gt;&lt;P&gt;Mon Mar 27 15:38:53 2023 : Auth: (30281447) Login incorrect (eap: rlm_eap (EAP): No EAP session matching state 0x6251908160558986): [plotter@connect.com.hk] (from client proxy1 port 0 cli 60AB67C12EFF)&lt;BR /&gt;Mon Mar 27 15:38:53 2023 : Auth: (30281447) Login incorrect (Home Server says so): [plotter@connect.hku.hk] (from client proxy1 port 0 cli 50EB67C12EFA)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I uploaded file with these 2 lines only to test again.&amp;nbsp;&amp;nbsp;&amp;nbsp; Tried different combinations by focusing on these 2 lines:&lt;/P&gt;&lt;P&gt;Not working:&lt;/P&gt;&lt;P&gt;startswith=eval(match(_raw, "(cli|eap)")) endswith="says" maxevents=2&lt;BR /&gt;startswith=eval(match(_raw, "(cli|eap)")) endswith=eval(match(_raw,"(says|TLS)")) maxevents=2&lt;/P&gt;&lt;P&gt;Can group into transaction:&lt;/P&gt;&lt;P&gt;startswith="eap" endswith=eval(match(_raw,"(says|TLS)")) maxevents=2&lt;BR /&gt;startswith="eap" endswith="says" maxevents=2&lt;/P&gt;&lt;P&gt;Did I miss anything?&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2023 03:17:05 GMT</pubDate>
    <dc:creator>stwong</dc:creator>
    <dc:date>2023-04-06T03:17:05Z</dc:date>
    <item>
      <title>Help with Regex in transaction endswith</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638585#M221284</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I try to group events using transaction.&amp;nbsp; Since there are multiple endswith condition, i tried following to match either one of the 3 string patterns but unable to match:&lt;/P&gt;
&lt;P&gt;... | transaction client endswith=eval(match(_raw, "string1|string2|string3"))&lt;/P&gt;
&lt;P&gt;Would anyone please help?&lt;/P&gt;
&lt;P&gt;Thanks a lot.&lt;/P&gt;
&lt;P&gt;Best Rgds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 19:29:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638585#M221284</guid>
      <dc:creator>stwong</dc:creator>
      <dc:date>2023-04-04T19:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transaction endswith</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638591#M221286</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/148178"&gt;@stwong&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far the only typos I've noticed in your regex are the missing parenthesis:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | transaction client endswith=eval(match(_raw, "(string1|string2|string3)"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that's still not matching please post details about your raw data and the actual regex you are using.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;J&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 08:37:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638591#M221286</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2023-04-04T08:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transaction endswith</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638600#M221289</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/113132"&gt;@javiergn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&amp;nbsp; Also tried adding parenthesis but still not working.&lt;/P&gt;&lt;P&gt;some sample data:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Mon Mar 27 15:38:53 2023 : Auth: (30281508) Login OK: [s123457@mydomain.hk] (from client proxy2 port 0 cli 1D6CE62B86E5)
Mon Mar 27 15:38:53 2023 : Auth: (30281507)   Login OK: [s123457@mydomain.hk] (from client proxy2 port 0 via TLS tunnel)
Mon Mar 27 15:38:53 2023 : Auth: (30281447) Login incorrect (eap: rlm_eap (EAP): No EAP session matching state 0x6251908160558986): [plotter@connect.com.hk] (from client proxy1 port 0 cli 60AB67C12EFF)
Mon Mar 27 15:38:53 2023 : Auth: (30281447) Login incorrect (Home Server says so): [plotter@connect.hku.hk] (from client proxy1 port 0 cli 50EB67C12EFA)
Mon Mar 27 15:38:53 2023 : Auth: (30281488) Login OK: [s2345666@mydomain.hk] (from client proxy1 port 0 cli 3421D3826F64)
Mon Mar 27 15:38:53 2023 : Auth: (30281487)   Login OK: [s2345666@mydomain.hk] (from client proxy1 port 0 via TLS tunnel)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then search with&lt;/P&gt;&lt;P&gt;... | transaction client, host maxevents=2 maxpause=2 startswith="cli" endswith=eval(match(_raw, "(says|TLS)"))&lt;/P&gt;&lt;P&gt;the result is same if i remove the endswith setting which seems has no effect.&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 08:58:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638600#M221289</guid>
      <dc:creator>stwong</dc:creator>
      <dc:date>2023-04-04T08:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transaction endswith</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638616#M221294</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have uploaded your data to my lab and then extracted what I think are the host and client fields (correct me if I'm wrong please). Then I did the transaction as per the below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo source=example
| rex "\[(?&amp;lt;host&amp;gt;[^\]]+).+client (?&amp;lt;client&amp;gt;\w+)"
| transaction client, host maxevents=2 maxpause=2 startswith="cli" endswith=eval(match(_raw, "(says|TLS)"))
| table client, host, _raw&lt;/LI-CODE&gt;&lt;P&gt;And this is what I see as output, which looks OK to me based on the client and host:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="javiergn_1-1680600307219.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24765iC84EA7671D3CC57A/image-size/large?v=v2&amp;amp;px=999" role="button" title="javiergn_1-1680600307219.png" alt="javiergn_1-1680600307219.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I remove the endswith from transaction this is what I get instead:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="javiergn_2-1680600358896.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24766iEE9C3DFCEF5B25A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="javiergn_2-1680600358896.png" alt="javiergn_2-1680600358896.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Which is very similar but not exactly the same. This is because you are forcing it to start with cli and then your maxevents are 2, meaning it's going to pick the next client/host combination matching the starting one. Whereas with the endswith you are forcing it to match says or TLS.&lt;/P&gt;&lt;P&gt;In any case, your event containing "says" won't match any other event in the list as the host (assumning I did the extraction correctly) is &lt;A href="mailto:plotter@connect.hku.hk" target="_blank"&gt;plotter@connect.hku.hk&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Let me know if that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 09:31:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638616#M221294</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2023-04-04T09:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transaction endswith</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638934#M221397</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;Sorry that the host field is the log source host, to make sure we're looking at logs come from the same host.&lt;/P&gt;&lt;P&gt;It's strange that if the 2 lines match the criteria:&lt;/P&gt;&lt;P&gt;* client, host value&lt;/P&gt;&lt;P&gt;&amp;nbsp;* startswith contains cli&lt;/P&gt;&lt;P&gt;* endswith contains says&lt;/P&gt;&lt;P&gt;but always can't be 'grouped' by transaction.&lt;/P&gt;&lt;P&gt;Mon Mar 27 15:38:53 2023 : Auth: (30281447) Login incorrect (eap: rlm_eap (EAP): No EAP session matching state 0x6251908160558986): [plotter@connect.com.hk] (from client proxy1 port 0 cli 60AB67C12EFF)&lt;BR /&gt;Mon Mar 27 15:38:53 2023 : Auth: (30281447) Login incorrect (Home Server says so): [plotter@connect.hku.hk] (from client proxy1 port 0 cli 50EB67C12EFA)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I uploaded file with these 2 lines only to test again.&amp;nbsp;&amp;nbsp;&amp;nbsp; Tried different combinations by focusing on these 2 lines:&lt;/P&gt;&lt;P&gt;Not working:&lt;/P&gt;&lt;P&gt;startswith=eval(match(_raw, "(cli|eap)")) endswith="says" maxevents=2&lt;BR /&gt;startswith=eval(match(_raw, "(cli|eap)")) endswith=eval(match(_raw,"(says|TLS)")) maxevents=2&lt;/P&gt;&lt;P&gt;Can group into transaction:&lt;/P&gt;&lt;P&gt;startswith="eap" endswith=eval(match(_raw,"(says|TLS)")) maxevents=2&lt;BR /&gt;startswith="eap" endswith="says" maxevents=2&lt;/P&gt;&lt;P&gt;Did I miss anything?&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 03:17:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638934#M221397</guid>
      <dc:creator>stwong</dc:creator>
      <dc:date>2023-04-06T03:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transaction endswith</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638964#M221405</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Just tried this combination works:&lt;/P&gt;&lt;P&gt;| transaction client, host startswith=eval(match(_raw,"eap|OK:.*0\s+cli")) endswith=eval(match(_raw,"TLS|says")) maxevents=2&lt;/P&gt;&lt;P&gt;Seems the pattern has to be &lt;SPAN&gt;unambiguous&lt;/SPAN&gt; among events to scan.&amp;nbsp;&lt;BR /&gt;Not sure if my interpretation is correct.&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;Best Rgds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 06:44:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/638964#M221405</guid>
      <dc:creator>stwong</dc:creator>
      <dc:date>2023-04-06T06:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Regex in transaction endswith</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/639121#M221446</link>
      <description>&lt;P&gt;The "transaction" command is one of the WORST scaling commands in all of splunk so it should never be used for a production use-case (because it fails without any indication and gives bad results).&amp;nbsp; You should use "streamstats" instead (you can google this site for "woodcock correlationID" and get many examples that will get you there.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 00:24:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Regex-in-transaction-endswith/m-p/639121#M221446</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2023-04-07T00:24:36Z</dc:date>
    </item>
  </channel>
</rss>

