<?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 Generate a dynamic multi-value field based on a specific field in a search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Generate-a-dynamic-multi-value-field-based-on-a-specific-field/m-p/432293#M123518</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I'm fairly new to Splunk searches.&lt;BR /&gt;
I have a search in a log :  &lt;CODE&gt;index=tutti sourcetype=toto status!=4&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Where I have 4 fields of interest namely : BeginTime (in epoch format), EndTime (in epoch format), LogTime (in epoch format) and Attempts.&lt;BR /&gt;
I want a search that would generate a dynamic multi-value field ("|" separated), let's call it LogTimes, based on the following logic :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;If Attempts =1 then LogTimes = LogTime
    elsif Attempts =2 then LogTimes = BeginTime|EndTime
    elsif Attempts =3 then LogTimes = BeginTime|BeginTime+(EndTime-BeginTime)/2|EndTime
    elsif Attempts = 4 then LogTimes = BeginTime|BeginTime+(EndTime-BeginTime)/3|BeginTime+2*(EndTime-BeginTime)/3|EndTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then it should count every timestamp occurrence (every single value in LogTimes) at the end.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;elsif Attempts = n  then LogTimes = BeginTime|BeginTime+(EndTime-BeginTime)/(n-1)|BeginTime+2*(EndTime-BeginTime)/(n-1)|..............|BeginTime+(n-2)*(EndTime-BeginTime)/(n-1)|EndTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone help me, please?&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2019 19:06:25 GMT</pubDate>
    <dc:creator>elaoumam</dc:creator>
    <dc:date>2019-06-17T19:06:25Z</dc:date>
    <item>
      <title>Generate a dynamic multi-value field based on a specific field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-a-dynamic-multi-value-field-based-on-a-specific-field/m-p/432293#M123518</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I'm fairly new to Splunk searches.&lt;BR /&gt;
I have a search in a log :  &lt;CODE&gt;index=tutti sourcetype=toto status!=4&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Where I have 4 fields of interest namely : BeginTime (in epoch format), EndTime (in epoch format), LogTime (in epoch format) and Attempts.&lt;BR /&gt;
I want a search that would generate a dynamic multi-value field ("|" separated), let's call it LogTimes, based on the following logic :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;If Attempts =1 then LogTimes = LogTime
    elsif Attempts =2 then LogTimes = BeginTime|EndTime
    elsif Attempts =3 then LogTimes = BeginTime|BeginTime+(EndTime-BeginTime)/2|EndTime
    elsif Attempts = 4 then LogTimes = BeginTime|BeginTime+(EndTime-BeginTime)/3|BeginTime+2*(EndTime-BeginTime)/3|EndTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then it should count every timestamp occurrence (every single value in LogTimes) at the end.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;elsif Attempts = n  then LogTimes = BeginTime|BeginTime+(EndTime-BeginTime)/(n-1)|BeginTime+2*(EndTime-BeginTime)/(n-1)|..............|BeginTime+(n-2)*(EndTime-BeginTime)/(n-1)|EndTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone help me, please?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 19:06:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-a-dynamic-multi-value-field-based-on-a-specific-field/m-p/432293#M123518</guid>
      <dc:creator>elaoumam</dc:creator>
      <dc:date>2019-06-17T19:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a dynamic multi-value field based on a specific field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-a-dynamic-multi-value-field-based-on-a-specific-field/m-p/432294#M123519</link>
      <description>&lt;P&gt;Can we have some sample data and corresponding output? Is the Attempts a field with literal numerical value of 1,2,3,4....?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 21:07:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-a-dynamic-multi-value-field-based-on-a-specific-field/m-p/432294#M123519</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-06-17T21:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a dynamic multi-value field based on a specific field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-a-dynamic-multi-value-field-based-on-a-specific-field/m-p/432295#M123520</link>
      <description>&lt;P&gt;Hi @somesoni2, yes it's a field with strict numerical values 1,2, 3, 4...&lt;BR /&gt;
a data sample would look like :&lt;BR /&gt;
Transaction_ID, status, Attempts, BeginTime, EndTime, LogTime&lt;BR /&gt;
aH345kli, 0, 5, 1560861000, 1560864000, 1560863000&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 14:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-a-dynamic-multi-value-field-based-on-a-specific-field/m-p/432295#M123520</guid>
      <dc:creator>elaoumam</dc:creator>
      <dc:date>2019-06-18T14:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a dynamic multi-value field based on a specific field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-a-dynamic-multi-value-field-based-on-a-specific-field/m-p/432296#M123521</link>
      <description>&lt;P&gt;Basically if I have an event like the following :&lt;BR /&gt;
Transaction_ID,status,Attempts,BeginTime,EndTime,LogTime&lt;BR /&gt;
aH345kli,0,3,1560861000,1560864000,1560863000&lt;BR /&gt;
I should end up with something like :&lt;BR /&gt;
Transaction_ID,status,Attempts,BeginTime,EndTime,LogTime,LogTimes&lt;BR /&gt;
aH345kli,0,3,1560861000,1560864000,1560863000,1560861000|1560862500|1560864000&lt;BR /&gt;
If it's like :&lt;BR /&gt;
Transaction_ID,status,Attempts,BeginTime,EndTime,LogTime&lt;BR /&gt;
aH345kli,0,1,1560861000,1560864000,1560863000&lt;BR /&gt;
It should be :&lt;BR /&gt;
Transaction_ID,status,Attempts,BeginTime,EndTime,LogTime,LogTimes&lt;BR /&gt;
aH345kli,0,1,1560861000,1560864000,1560863000,1560863000&lt;BR /&gt;
and so on.&lt;BR /&gt;
And then return the corresponding total count of each timestamp in LogTimes (on all event) in a span of 1 min.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-a-dynamic-multi-value-field-based-on-a-specific-field/m-p/432296#M123521</guid>
      <dc:creator>elaoumam</dc:creator>
      <dc:date>2020-09-30T01:00:50Z</dc:date>
    </item>
  </channel>
</rss>

