<?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: Multi-series timechart - struggling to get it working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608634#M211639</link>
    <description>&lt;P&gt;Thanks for the suggestions, but I was unfortunately not able to get the results properly formatted with those. I was lucky to find a Splunk expert internally at our company that helped me to create the following query that seems to work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;| rex field=_raw max_match=0 " (?&amp;lt;TRANSNAME&amp;gt;.*) - RespTimeAvg: (?&amp;lt;TRANSPERSEC&amp;gt;.*).*" | eval TRANSACTION=mvzip(TRANSNAME,TRANSPERSEC,"|")|mvexpand TRANSACTION|search TRANSACTION!="*N/A*"|eval TRANSNAME2=mvindex(split(TRANSACTION,"|"),0),TRANSPERSEC2=mvindex(split(TRANSACTION,"|"),1)|chart useother=f limit=0 list(TRANSPERSEC2) over _time by TRANSNAME2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems like this query got complex due to the&amp;nbsp;&lt;SPAN&gt;multivalues and multiple key value pairs for each name in the event.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2022 06:41:21 GMT</pubDate>
    <dc:creator>dmoberg</dc:creator>
    <dc:date>2022-08-08T06:41:21Z</dc:date>
    <item>
      <title>Struggling with Multi-series timechart- How to write this rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608076#M211429</link>
      <description>&lt;P&gt;Each Event contains 1-many Transaction Names with associated metrics as per the below example:&lt;/P&gt;
&lt;P&gt;2022-08-03T08:47:49.4554569Z TransNames: DavidTrans_2 DavidTrans_1 Total DavidTrans_3&lt;BR /&gt;2022-08-03T08:47:49.4633642Z Name: DavidTrans_2&lt;BR /&gt;2022-08-03T08:47:49.4995979Z DavidTrans_2 - TransactionsPerSec: 0.92&lt;BR /&gt;2022-08-03T08:47:49.5180222Z Name: DavidTrans_1&lt;BR /&gt;2022-08-03T08:47:49.5245825Z DavidTrans_1 - TransactionsPerSec: 0.96&lt;BR /&gt;2022-08-03T08:47:49.5339575Z Name: DavidTrans_3&lt;BR /&gt;2022-08-03T08:47:49.5405933Z DavidTrans_3 - TransactionsPerSec: 0.97&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;From this Event I want to create a multi-series Timechart, where X is _Time, (Event time), Y is the value for Transactions Per Second and where each graph line represents one of the Transactions (DavidTrans_1, DavidTrans_2, DavidTrans_3. This is just an example and the Transaction name and number of transactions will differ.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;I have tried many different ways of doing this, but will paste what I just tried, which does not display any metrics and where the format is completely screwed up.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;SEARCH XXXXXXXXX | rex field=_raw max_match=0 " (?&amp;lt;TRANSNAME&amp;gt;.*) - TransactionsPerSec: (?&amp;lt;TRANSPERSEC&amp;gt;.*).*" | timechart list(TRANSNAME),list(TRANSPERSEC) by TRANSNAME&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;I can add that using the stats command I can at least get the values in a nice table:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;SEARCH XXXXXXXXX | rex field=_raw max_match=0 " (?&amp;lt;TRANSNAME&amp;gt;.*) - TransactionsPerSec: (?&amp;lt;TRANSPERSEC&amp;gt;.*).*" | stats list(TRANSNAME),list(TRANSPERSEC)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dmoberg_0-1659529502636.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20826i71038EAB1566D2B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dmoberg_0-1659529502636.png" alt="dmoberg_0-1659529502636.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I feel I have done similar things before but for some reason getting the values displayed in a Timechart was tricky this time.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 15:24:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608076#M211429</guid>
      <dc:creator>dmoberg</dc:creator>
      <dc:date>2022-08-03T15:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-series timechart - struggling to get it working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608085#M211431</link>
      <description>&lt;P&gt;&lt;SPAN&gt;2022-08-03T08:47:49.5245825Z DavidTrans_1 - TransactionsPerSec: 0.96&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;| rex "Z\s+(&lt;SPAN&gt;?&amp;lt;TRANSNAME&amp;gt;.*)\s*-\s*TransactionsPerSec:\s*(?&amp;lt;TRANSPERSEC&amp;gt;\S+)"&lt;BR /&gt;| timechart avg(TRANSPERSEC) as TRANSPERSEC by TRANSNAME&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;You want to see the field value of&amp;nbsp;&lt;SPAN&gt;TRANSPERSEC per TRANSNAME.&amp;nbsp; List can contain multivalues which doesnt work well with graphing. Try to use avg, min, max, median etc instead of list.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 13:39:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608085#M211431</guid>
      <dc:creator>martinpu</dc:creator>
      <dc:date>2022-08-03T13:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-series timechart - struggling to get it working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608092#M211435</link>
      <description>&lt;P&gt;If I do this then all of the values are averaged out instead of displaying the individual values for each Transaction. See below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dmoberg_0-1659535816628.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20827iE1345C2B8E564671/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dmoberg_0-1659535816628.png" alt="dmoberg_0-1659535816628.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But the look of the graph is better......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 14:10:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608092#M211435</guid>
      <dc:creator>dmoberg</dc:creator>
      <dc:date>2022-08-03T14:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-series timechart - struggling to get it working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608096#M211437</link>
      <description>&lt;P&gt;You can force more bins by doing:&lt;/P&gt;&lt;PRE&gt;| rex "Z\s+(&lt;SPAN&gt;?&amp;lt;TRANSNAME&amp;gt;.*)\s*-\s*TransactionsPerSec:\s*(?&amp;lt;TRANSPERSEC&amp;gt;\S+)"&lt;BR /&gt;| timechart bins=500 avg(TRANSPERSEC) as TRANSPERSEC by TRANSNAME&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Just increase the bins number.&lt;/P&gt;&lt;P&gt;Could also try this to expand all the multivalues:&lt;/P&gt;&lt;PRE&gt;| rex "Z\s+(&lt;SPAN&gt;?&amp;lt;TRANSNAME&amp;gt;.*)\s*-\s*TransactionsPerSec:\s*(?&amp;lt;TRANSPERSEC&amp;gt;\S+)"&lt;BR /&gt;| timechart list(TRANSPERSEC) as TRANSPERSEC by TRANSNAME&lt;/SPAN&gt;&lt;BR /&gt;| foreach * [ |mvexpand &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;]&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 14:31:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608096#M211437</guid>
      <dc:creator>martinpu</dc:creator>
      <dc:date>2022-08-03T14:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-series timechart - struggling to get it working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608634#M211639</link>
      <description>&lt;P&gt;Thanks for the suggestions, but I was unfortunately not able to get the results properly formatted with those. I was lucky to find a Splunk expert internally at our company that helped me to create the following query that seems to work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;| rex field=_raw max_match=0 " (?&amp;lt;TRANSNAME&amp;gt;.*) - RespTimeAvg: (?&amp;lt;TRANSPERSEC&amp;gt;.*).*" | eval TRANSACTION=mvzip(TRANSNAME,TRANSPERSEC,"|")|mvexpand TRANSACTION|search TRANSACTION!="*N/A*"|eval TRANSNAME2=mvindex(split(TRANSACTION,"|"),0),TRANSPERSEC2=mvindex(split(TRANSACTION,"|"),1)|chart useother=f limit=0 list(TRANSPERSEC2) over _time by TRANSNAME2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems like this query got complex due to the&amp;nbsp;&lt;SPAN&gt;multivalues and multiple key value pairs for each name in the event.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 06:41:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608634#M211639</guid>
      <dc:creator>dmoberg</dc:creator>
      <dc:date>2022-08-08T06:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-series timechart - struggling to get it working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608641#M211640</link>
      <description>&lt;P&gt;Assuming the only useful events are those with TransactionsPerSec, try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SEARCH XXXXXXXXX "TransactionsPerSec"
| rex field=_raw max_match=0 " (?&amp;lt;TRANSNAME&amp;gt;.*) - TransactionsPerSec: (?&amp;lt;TRANSPERSEC&amp;gt;.*).*" 
| eval {TRANSNAME} = TRANSPERSEC
| fields - TRANSNAME TRANSPERSEC&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Aug 2022 07:15:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Struggling-with-Multi-series-timechart-How-to-write-this-rex/m-p/608641#M211640</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-08T07:15:24Z</dc:date>
    </item>
  </channel>
</rss>

