<?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 assigning repeating / rolling sequential field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467103#M131456</link>
    <description>&lt;P&gt;I am looking to have a new field that will assign a reference to each, this reference will be sequential and will repeat.&lt;/P&gt;

&lt;P&gt;e.g.&lt;BR /&gt;
Record . . . ref&lt;BR /&gt;
1, 6, 11 . . . 1&lt;BR /&gt;
2, 7, 12 . . . 2&lt;BR /&gt;
but the number of records is going to change as will the number for the first record so it needs to work on the order of the records.&lt;BR /&gt;
I had thought stream stats but can't see a way to make it work.&lt;/P&gt;

&lt;P&gt;Many thanks for any help &lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2019 17:25:56 GMT</pubDate>
    <dc:creator>ChrisCLewis</dc:creator>
    <dc:date>2019-12-17T17:25:56Z</dc:date>
    <item>
      <title>assigning repeating / rolling sequential field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467103#M131456</link>
      <description>&lt;P&gt;I am looking to have a new field that will assign a reference to each, this reference will be sequential and will repeat.&lt;/P&gt;

&lt;P&gt;e.g.&lt;BR /&gt;
Record . . . ref&lt;BR /&gt;
1, 6, 11 . . . 1&lt;BR /&gt;
2, 7, 12 . . . 2&lt;BR /&gt;
but the number of records is going to change as will the number for the first record so it needs to work on the order of the records.&lt;BR /&gt;
I had thought stream stats but can't see a way to make it work.&lt;/P&gt;

&lt;P&gt;Many thanks for any help &lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 17:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467103#M131456</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2019-12-17T17:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: assigning repeating / rolling sequential field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467104#M131457</link>
      <description>&lt;P&gt;It's unclear how the 'Ref' column is to be computed.  Please explain.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 20:34:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467104#M131457</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-12-17T20:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: assigning repeating / rolling sequential field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467105#M131458</link>
      <description>&lt;P&gt;+1 to what @richgalloway said. Ideally you can give us a few more example logs and the edge cases you want the code to be able to handle, as well as why streamstats won't work. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 22:13:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467105#M131458</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-12-17T22:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: assigning repeating / rolling sequential field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467106#M131459</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;Thank you for getting back.  &lt;/P&gt;

&lt;P&gt;What is in the logs will not determine what the reference number would be.&lt;BR /&gt;
I am looking at a fixed range of references e.g. 1 through 5 (could also easily be a through e) and the earliest / record would take a reference of one&lt;BR /&gt;
2nd, a ref of 2&lt;BR /&gt;
3rd, a ref of 3&lt;BR /&gt;
4th, a ref of 4&lt;BR /&gt;
5th, a ref of 5&lt;BR /&gt;
6th, a ref of 1&lt;BR /&gt;
7th, a ref of 2&lt;BR /&gt;
...&lt;BR /&gt;
10th, a ref of 5&lt;BR /&gt;
11th, a ref of 1 etc&lt;BR /&gt;
this would continue through all records until they all have a ref from the 1 through 5 range.&lt;/P&gt;

&lt;P&gt;There could easily be 5 million records to go through.&lt;/P&gt;

&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 09:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467106#M131459</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2019-12-18T09:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: assigning repeating / rolling sequential field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467107#M131460</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults count=5000
| streamstats current=f count
| eval ref = "a ref of ".((count % 5) + 1)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @ChrisCLewis&lt;BR /&gt;
My machine can't work with &lt;CODE&gt;count=500000000&lt;/CODE&gt; &lt;BR /&gt;
but , your machine will work.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 13:07:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467107#M131460</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-18T13:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: assigning repeating / rolling sequential field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467108#M131461</link>
      <description>&lt;P&gt;Many thanks for the answer, never clocked the "current=f" option...&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 14:04:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assigning-repeating-rolling-sequential-field/m-p/467108#M131461</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2019-12-18T14:04:21Z</dc:date>
    </item>
  </channel>
</rss>

