<?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: How to get multiple dynamic values from a single log line in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-multiple-dynamic-values-from-a-single-log-line/m-p/393496#M114440</link>
    <description>&lt;P&gt;Awesome that worked. I had played with the mv functions before but couldn't get it to work. Much appreciated&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2019 03:06:55 GMT</pubDate>
    <dc:creator>littlgra</dc:creator>
    <dc:date>2019-04-11T03:06:55Z</dc:date>
    <item>
      <title>How to get multiple dynamic values from a single log line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-multiple-dynamic-values-from-a-single-log-line/m-p/393494#M114438</link>
      <description>&lt;P&gt;We have numerous log lines that are in a format similar to the following:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-04-09 13:00:03 DEBUG DynamicName1 1000 (1.00) ; DynamicName2 2000 (2.00) ; 
2019-04-09 13:00:02 DEBUG DynamicName2 500 (0.50) ; DynamicName4 3100 (3.10) ; DynamicName5 12000 (12.00) ;
2019-04-09 13:00:00 DEBUG DynamicName1 600 (0.60) ; DynamicName5 2100 (2.10) ;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The DynamicName# is a dynamic string that can have multiple values per line (but never the same value per line), the numbers after it represent a timing in milliseconds and then seconds.&lt;/P&gt;

&lt;P&gt;What I want to get is a table of all the unique DynamicName(s), their average execution times and counts&lt;/P&gt;

&lt;P&gt;However, I can't quite get the extraction correct. When I use a rex, for example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "(?&amp;lt;name&amp;gt;\w+) (?&amp;lt;time&amp;gt;\d+) \(\d+.\d+\)"  | table name time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However this creates a table of multiple values per row and then I can't use other commands on it correctly. For example:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "(?&amp;lt;name&amp;gt;\w+) (?&amp;lt;time&amp;gt;\d+) \(\d+.\d+\) ; "  | table name time | sort -time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does not result in the correct result I am expecting.&lt;/P&gt;

&lt;P&gt;Is there a way I can correctly extract the data to get true dynamic multiple values that I can then table with 1 DynamicName per table row&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 06:10:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-multiple-dynamic-values-from-a-single-log-line/m-p/393494#M114438</guid>
      <dc:creator>littlgra</dc:creator>
      <dc:date>2019-04-09T06:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to get multiple dynamic values from a single log line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-multiple-dynamic-values-from-a-single-log-line/m-p/393495#M114439</link>
      <description>&lt;P&gt;Try splitting it up into a mv field after stripping out the first characters that aren't needed: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval foo=replace(_raw, "\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} DEBUG", "")
| makemv delim=";" foo
| mvexpand foo
| rex field=foo "(?&amp;lt;name&amp;gt;\w+) (?&amp;lt;time&amp;gt;\d+) \(\d+.\d+\)"
| table name time | sort -time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you can use mvexpand to split it up into multiple events and your regex can work on that.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 14:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-multiple-dynamic-values-from-a-single-log-line/m-p/393495#M114439</guid>
      <dc:creator>grittonc</dc:creator>
      <dc:date>2019-04-10T14:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get multiple dynamic values from a single log line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-multiple-dynamic-values-from-a-single-log-line/m-p/393496#M114440</link>
      <description>&lt;P&gt;Awesome that worked. I had played with the mv functions before but couldn't get it to work. Much appreciated&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 03:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-multiple-dynamic-values-from-a-single-log-line/m-p/393496#M114440</guid>
      <dc:creator>littlgra</dc:creator>
      <dc:date>2019-04-11T03:06:55Z</dc:date>
    </item>
  </channel>
</rss>

