<?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: Create a new row based on two fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155784#M43835</link>
    <description>&lt;P&gt;What are you trying to do?&lt;/P&gt;

&lt;P&gt;Append this to your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | eval temp = mvrange(0,time_delta) | mvexpand temp | eval start_time = start_time + temp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note, this will only work reasonably well for small positive values of &lt;CODE&gt;time_delta&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jul 2014 07:53:30 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-07-24T07:53:30Z</dc:date>
    <item>
      <title>Create a new row based on two fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155783#M43834</link>
      <description>&lt;P&gt;Good day Splunkers,&lt;/P&gt;

&lt;P&gt;I have this table example consisting of 4 fields naming &lt;CODE&gt;(src_ip, start_time, time_delta, avg_bytes)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;example:&lt;BR /&gt;
&lt;TABLE&gt;&lt;BR /&gt;
  &lt;TBODY&gt;&lt;TR align="center"&gt;&lt;BR /&gt;
    &lt;TH&gt;src_ip&lt;/TH&gt;&lt;BR /&gt;
    &lt;TH&gt;start_time&lt;/TH&gt;&lt;BR /&gt;
    &lt;TH&gt;time_delta&lt;/TH&gt;&lt;BR /&gt;
    &lt;TH&gt;avg_bytes&lt;/TH&gt;&lt;BR /&gt;
  &lt;/TR&gt;&lt;BR /&gt;
  &lt;TR align="center"&gt;&lt;BR /&gt;
    &lt;TD&gt;1.2.3.4&lt;/TD&gt;&lt;BR /&gt;
    &lt;TD&gt;1405305768&lt;/TD&gt;&lt;BR /&gt;
    &lt;TD&gt;5&lt;/TD&gt;&lt;BR /&gt;
    &lt;TD&gt;123.45&lt;/TD&gt;&lt;BR /&gt;
  &lt;/TR&gt;&lt;BR /&gt;
&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
Now for the question, is it possible to create a new set of rows based on the fields &lt;CODE&gt;start_time and time_delta&lt;/CODE&gt;? Where the number of this new rows is based on &lt;CODE&gt;time_delta&lt;/CODE&gt; and the value of this row is &lt;CODE&gt;start_time + 1&lt;/CODE&gt;. Looking at my example, we would create 4 new rows (based on &lt;CODE&gt;time_delta-1&lt;/CODE&gt;) the values of this rows would be 1405305768,1405305769,1405305770,1405305771,1405305772&lt;/P&gt;

&lt;TABLE&gt;
  &lt;TBODY&gt;&lt;TR align="center"&gt;
    &lt;TH&gt;src_ip&lt;/TH&gt;
    &lt;TH&gt;start_time&lt;/TH&gt;
    &lt;TH&gt;time_delta&lt;/TH&gt;
    &lt;TH&gt;avg_bytes&lt;/TH&gt;
  &lt;/TR&gt;
  &lt;TR align="center"&gt;
    &lt;TD&gt;1.2.3.4&lt;/TD&gt;
    &lt;TD&gt;1405305768&lt;/TD&gt;
    &lt;TD&gt;5&lt;/TD&gt;
    &lt;TD&gt;123.45&lt;/TD&gt;
  &lt;/TR&gt;
  &lt;TR align="center"&gt;
    &lt;TD&gt;1.2.3.4&lt;/TD&gt;
    &lt;TD&gt;1405305769&lt;/TD&gt;
    &lt;TD&gt;5&lt;/TD&gt;
    &lt;TD&gt;123.45&lt;/TD&gt;
  &lt;/TR&gt;
  &lt;TR align="center"&gt;
    &lt;TD&gt;1.2.3.4&lt;/TD&gt;
    &lt;TD&gt;1405305770&lt;/TD&gt;
    &lt;TD&gt;5&lt;/TD&gt;
    &lt;TD&gt;123.45&lt;/TD&gt;
  &lt;/TR&gt;
  &lt;TR align="center"&gt;
    &lt;TD&gt;1.2.3.4&lt;/TD&gt;
    &lt;TD&gt;1405305771&lt;/TD&gt;
    &lt;TD&gt;5&lt;/TD&gt;
    &lt;TD&gt;123.45&lt;/TD&gt;
  &lt;/TR&gt;
  &lt;TR align="center"&gt;
    &lt;TD&gt;1.2.3.4&lt;/TD&gt;
    &lt;TD&gt;1405305772&lt;/TD&gt;
    &lt;TD&gt;5&lt;/TD&gt;
    &lt;TD&gt;123.45&lt;/TD&gt;
  &lt;/TR&gt;
&lt;/TBODY&gt;&lt;/TABLE&gt;

&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;I'm kinda lost now on my search, Is there a splunk search term for this kind of situation. It would be a great help.&lt;/P&gt;

&lt;P&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:09:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155783#M43834</guid>
      <dc:creator>crt89</dc:creator>
      <dc:date>2020-09-28T17:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new row based on two fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155784#M43835</link>
      <description>&lt;P&gt;What are you trying to do?&lt;/P&gt;

&lt;P&gt;Append this to your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | eval temp = mvrange(0,time_delta) | mvexpand temp | eval start_time = start_time + temp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note, this will only work reasonably well for small positive values of &lt;CODE&gt;time_delta&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2014 07:53:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155784#M43835</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-24T07:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new row based on two fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155785#M43836</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/172708"&gt;@martin_mueller&lt;/a&gt;, what I was trying to do is add some rows. What I have above is example of what output of report I would like to make. For your answer you have said that it will only work for some extent. I have time_delta values that ranges to 50+. But I will still try this and be back on the outcomes.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:09:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155785#M43836</guid>
      <dc:creator>crt89</dc:creator>
      <dc:date>2020-09-28T17:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new row based on two fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155786#M43837</link>
      <description>&lt;P&gt;50+ shouldn't be any issue. At some point you'll hit configured limits of &lt;CODE&gt;mvexpand&lt;/CODE&gt;, that might be 50000 or so.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2014 12:10:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155786#M43837</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-24T12:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new row based on two fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155787#M43838</link>
      <description>&lt;P&gt;Hi @martin_mueller the command works, I think I won't have a 50000 time delta. Thanks again, already marked your answer&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2014 06:20:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-new-row-based-on-two-fields/m-p/155787#M43838</guid>
      <dc:creator>crt89</dc:creator>
      <dc:date>2014-07-25T06:20:18Z</dc:date>
    </item>
  </channel>
</rss>

