<?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 Transactions With Variable start/end? in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Transactions-With-Variable-start-end/m-p/455595#M9626</link>
    <description>&lt;P&gt;I have a log with many instances of the following ... these can happen in parallel.  I was attempting to use a transaction to mine these via startswith="Received Query" and endswith="Completed Query".&lt;/P&gt;

&lt;P&gt;&amp;lt;2018.10.29 10:02:37 639 -0400&amp;gt;&lt;I&gt;  Received Query on NE:38.120.48.29,{"targetClass":"nsd-service:/services/eline-sites/site","operator":"=","field":"classId","value":"nsd-service:/services/eline-sites/site"}, For BOTH Attributes&lt;BR /&gt;
&amp;lt;2018.10.29 10:02:37 639 -0400&amp;gt;&lt;I&gt;  Received Query on NE:38.120.48.29,{"targetClass":"nsd-service:/services/eline-sites/site","operator":"=","field":"classId","value":"nsd-service:/services/eline-sites/site"}, For BOTH Attributes&lt;BR /&gt;
&amp;lt;2018.10.29 10:02:37 639 -0400&amp;gt;&lt;I&gt;  Received Query on NE:38.120.48.29,{"targetClass":"nsd-service:/services/eline-sites/site","operator":"=","field":"classId","value":"nsd-service:/services/eline-sites/site"}, For BOTH Attributes&lt;BR /&gt;
&amp;lt;2018.10.29 10:02:38 696 -0400&amp;gt;&lt;I&gt; Completed Query: NE 38.120.48.29 Target Class nsd-service:/services/eline-sites/site&lt;BR /&gt;
&amp;lt;2018.10.29 10:02:38 696 -0400&amp;gt;&lt;I&gt; Completed Query: NE 38.120.48.29 Target Class nsd-service:/services/eline-sites/site&lt;BR /&gt;
&amp;lt;2018.10.29 10:02:38 696 -0400&amp;gt;&lt;I&gt; Completed Query: NE 38.120.48.29 Target Class nsd-service:/services/eline-sites/site&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;The problem is that since these can happen in parallel, I can mismatch start and end events.  The way you know which ones match are based on the thread number ... 24 or 25 or 26 in this case.  Is there a way to extract that dynamic number and use it to form the transaction ...&lt;/P&gt;

&lt;P&gt;transaction startswith="Received Query" and endswith="Completed Query"  ... and "contains" the dynamically generated number?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Oct 2018 17:14:49 GMT</pubDate>
    <dc:creator>dmoulais</dc:creator>
    <dc:date>2018-10-30T17:14:49Z</dc:date>
    <item>
      <title>Transactions With Variable start/end?</title>
      <link>https://community.splunk.com/t5/Reporting/Transactions-With-Variable-start-end/m-p/455595#M9626</link>
      <description>&lt;P&gt;I have a log with many instances of the following ... these can happen in parallel.  I was attempting to use a transaction to mine these via startswith="Received Query" and endswith="Completed Query".&lt;/P&gt;

&lt;P&gt;&amp;lt;2018.10.29 10:02:37 639 -0400&amp;gt;&lt;I&gt;  Received Query on NE:38.120.48.29,{"targetClass":"nsd-service:/services/eline-sites/site","operator":"=","field":"classId","value":"nsd-service:/services/eline-sites/site"}, For BOTH Attributes&lt;BR /&gt;
&amp;lt;2018.10.29 10:02:37 639 -0400&amp;gt;&lt;I&gt;  Received Query on NE:38.120.48.29,{"targetClass":"nsd-service:/services/eline-sites/site","operator":"=","field":"classId","value":"nsd-service:/services/eline-sites/site"}, For BOTH Attributes&lt;BR /&gt;
&amp;lt;2018.10.29 10:02:37 639 -0400&amp;gt;&lt;I&gt;  Received Query on NE:38.120.48.29,{"targetClass":"nsd-service:/services/eline-sites/site","operator":"=","field":"classId","value":"nsd-service:/services/eline-sites/site"}, For BOTH Attributes&lt;BR /&gt;
&amp;lt;2018.10.29 10:02:38 696 -0400&amp;gt;&lt;I&gt; Completed Query: NE 38.120.48.29 Target Class nsd-service:/services/eline-sites/site&lt;BR /&gt;
&amp;lt;2018.10.29 10:02:38 696 -0400&amp;gt;&lt;I&gt; Completed Query: NE 38.120.48.29 Target Class nsd-service:/services/eline-sites/site&lt;BR /&gt;
&amp;lt;2018.10.29 10:02:38 696 -0400&amp;gt;&lt;I&gt; Completed Query: NE 38.120.48.29 Target Class nsd-service:/services/eline-sites/site&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;The problem is that since these can happen in parallel, I can mismatch start and end events.  The way you know which ones match are based on the thread number ... 24 or 25 or 26 in this case.  Is there a way to extract that dynamic number and use it to form the transaction ...&lt;/P&gt;

&lt;P&gt;transaction startswith="Received Query" and endswith="Completed Query"  ... and "contains" the dynamically generated number?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 17:14:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Transactions-With-Variable-start-end/m-p/455595#M9626</guid>
      <dc:creator>dmoulais</dc:creator>
      <dc:date>2018-10-30T17:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Transactions With Variable start/end?</title>
      <link>https://community.splunk.com/t5/Reporting/Transactions-With-Variable-start-end/m-p/455596#M9627</link>
      <description>&lt;P&gt;is the thread number in your event? or can you pull it out with a regex?  If you can you could do something like this. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| transaction ThreadNum  startswith="Received Query" endswith="CompletedQuery" maxevents=2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Oct 2018 18:29:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Transactions-With-Variable-start-end/m-p/455596#M9627</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-10-30T18:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transactions With Variable start/end?</title>
      <link>https://community.splunk.com/t5/Reporting/Transactions-With-Variable-start-end/m-p/455597#M9628</link>
      <description>&lt;P&gt;Yes this works thanks - I frequently forget you can use a field name as a transaction grouping &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;index=xxhost=vm4 source="/opt/nsp/mediation/log/xx.log" "xx-grpc-exec" AND ( "Received Query" OR "Completed Query" ) | rex "-exec[(?\d+)]" | transaction threadId startswith="Received Query" endswith="Completed Query" | chart values(duration) as "Query Time" by _time&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 18:42:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Transactions-With-Variable-start-end/m-p/455597#M9628</guid>
      <dc:creator>dmoulais</dc:creator>
      <dc:date>2018-10-30T18:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Transactions With Variable start/end?</title>
      <link>https://community.splunk.com/t5/Reporting/Transactions-With-Variable-start-end/m-p/455598#M9629</link>
      <description>&lt;P&gt;perfect!  I'll convert it to an answer so you can accept it. &lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 18:43:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Transactions-With-Variable-start-end/m-p/455598#M9629</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-10-30T18:43:18Z</dc:date>
    </item>
  </channel>
</rss>

