<?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: Help with a join search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699266#M237397</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/270653"&gt;@tomjb94&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes obviously, yu have to extract the fields using regexes.&lt;/P&gt;&lt;P&gt;I can help you, with the following regex that extract all the values but the orderCode, that I don't know with part of the logs is, if you want my help about this, please, highlight this value in your logs using bold..&lt;/P&gt;&lt;P&gt;Anyway, you can use a search like the following (except orderCode):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test
| rex "^\[2024-09-10 07:27:46\.424 \(TID:(?&amp;lt;merchantCode&amp;gt;\d+).*\&amp;lt;subState\&amp;gt;(?&amp;lt;subState&amp;gt;\w+).*\&amp;lt;subCountryCode\&amp;gt;(?&amp;lt;subCountryCode&amp;gt;\d+)"
| search merchantCode=MERCHANTCODE1 subCountryCode=* subState=* 
| stats count by merchantCode subCountryCode subState&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can test the regex at&amp;nbsp;&lt;A href="https://regex101.com/r/KZMUxp/1" target="_blank"&gt;https://regex101.com/r/KZMUxp/1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then it isn't so clear for me if you need also the other fields (&lt;SPAN&gt;SubState, SubCountryCode, SubCity, PFID, SubName, SubID, SubPostalCode, SubTaxID).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If yes, you have to extract all of them, if you want my help, please indicate the part of log of each of them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2024 09:59:39 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-09-17T09:59:39Z</dc:date>
    <item>
      <title>Help with a join search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699264#M237396</link>
      <description>&lt;P&gt;Hi All -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need help with a fairly complex search i am being asked to build by a user.&lt;/P&gt;
&lt;P&gt;The ask is that the below fields are extracted from this XML sample:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:&lt;SPAN class=""&gt;14567876&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;subMerchantData&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:&lt;SPAN class=""&gt;dad4d2e725854048&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;pfId&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;499072&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;/pfId&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:&lt;SPAN class=""&gt;145767627&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;subName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;testname&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;/subName&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:&lt;SPAN class=""&gt;dad4d2e725854048&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;subId&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;123456&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;/subId&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:&lt;SPAN class=""&gt;145767627&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;subStreet&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;1 TEST LANE&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;/subStreet&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:&lt;SPAN class=""&gt;145767627&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;subCity&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;HongKong&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;/subCity&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:&lt;SPAN class=""&gt;145767627&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;subState&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;HK&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;/subState&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:&lt;SPAN class=""&gt;dad4d2e725854048&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;subCountryCode&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;344&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;/subCountryCode&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:&lt;SPAN class=""&gt;dad4d2e725854048&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;subPostalCode&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;1556677&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;/subPostalCode&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:&lt;SPAN class=""&gt;dad4d2e725854048&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;subTaxId&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;-15566777&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;/subTaxId&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2024-09-10&lt;/SPAN&gt; &lt;SPAN class=""&gt;07:27:46.424&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;TID:14567876&lt;/SPAN&gt;&lt;SPAN&gt;)] &amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;/subMerchantData&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This search doesn't pull anything back, i believe because they are not extracted fields&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=test  merchantCode=MERCHANTCODE1 subCountryCode=* subState=* orderCode=* | stats count by merchantCode subCountryCode subState orderCode&lt;/LI-CODE&gt;
&lt;P&gt;In addition to these fields&amp;nbsp;&lt;SPAN&gt;&lt;SPAN class=""&gt;SubState, SubCountryCode, SubCity, PFID, SubName, SubID, SubPostalCode, SubTaxID&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;However i'm not sure how this can be fulfilled, could anyone support with writing a search that would allow me to extract this info within a stats count?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 14:14:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699264#M237396</guid>
      <dc:creator>tomjb94</dc:creator>
      <dc:date>2024-09-17T14:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a join search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699266#M237397</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/270653"&gt;@tomjb94&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes obviously, yu have to extract the fields using regexes.&lt;/P&gt;&lt;P&gt;I can help you, with the following regex that extract all the values but the orderCode, that I don't know with part of the logs is, if you want my help about this, please, highlight this value in your logs using bold..&lt;/P&gt;&lt;P&gt;Anyway, you can use a search like the following (except orderCode):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test
| rex "^\[2024-09-10 07:27:46\.424 \(TID:(?&amp;lt;merchantCode&amp;gt;\d+).*\&amp;lt;subState\&amp;gt;(?&amp;lt;subState&amp;gt;\w+).*\&amp;lt;subCountryCode\&amp;gt;(?&amp;lt;subCountryCode&amp;gt;\d+)"
| search merchantCode=MERCHANTCODE1 subCountryCode=* subState=* 
| stats count by merchantCode subCountryCode subState&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can test the regex at&amp;nbsp;&lt;A href="https://regex101.com/r/KZMUxp/1" target="_blank"&gt;https://regex101.com/r/KZMUxp/1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then it isn't so clear for me if you need also the other fields (&lt;SPAN&gt;SubState, SubCountryCode, SubCity, PFID, SubName, SubID, SubPostalCode, SubTaxID).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If yes, you have to extract all of them, if you want my help, please indicate the part of log of each of them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 09:59:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699266#M237397</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-17T09:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a join search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699268#M237398</link>
      <description>&lt;P&gt;First things first. What does your raw data looks like? The sample you pasted - is it one event or are these multiple events? Where from and how are you getting this data? Because it looks as if it was XML horribly butchered by spliting into single lines and sending each line separately. And that's first thing that should be fixed instead of trying to do walkarounds in search time.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 10:03:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699268#M237398</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-09-17T10:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a join search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699274#M237399</link>
      <description>&lt;P&gt;Hi Giussepe,&amp;nbsp; Many thanks for your response, its greatly appreciated. I need the rex to be dynamic regardless of the particular timestamp in the original message i sent, its going to be a saved search. In addition, when i run this i get 0 results despite running exactly within the timestamp of that particular message in Splunk. I think this search may be quite expensive on our indexers, so for now i'll just get this working with the existing extracted fields. Thanks again, Tom&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 11:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699274#M237399</guid>
      <dc:creator>tomjb94</dc:creator>
      <dc:date>2024-09-17T11:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a join search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699277#M237401</link>
      <description>&lt;P class="lia-align-left"&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/270653"&gt;@tomjb94&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;let us know if we can help you more, or, please, accept one answer for the other people of Community.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 12:28:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-join-search/m-p/699277#M237401</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-17T12:28:17Z</dc:date>
    </item>
  </channel>
</rss>

