<?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: Distribute a value form an event over a given time period in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607719#M211320</link>
    <description>&lt;P&gt;Can you share some sample events - preferably in a code block &amp;lt;/&amp;gt; (rather than paragraph text or graphic) as it makes it easer to replicate your usecase, and suggest a solution?&lt;/P&gt;</description>
    <pubDate>Mon, 01 Aug 2022 09:01:10 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-08-01T09:01:10Z</dc:date>
    <item>
      <title>How to distribute a value form an event over a given time period?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607711#M211317</link>
      <description>&lt;P&gt;Data Model (simplified):&lt;/P&gt;
&lt;P&gt;- numeric value "Hours"&lt;/P&gt;
&lt;P&gt;- numeric value "StartTime" (assumed to always have time be 00:00:00) in UnixTime&lt;/P&gt;
&lt;P&gt;- numeric value "EndTime" (same assumptionm as above) in UnixTime&lt;/P&gt;
&lt;P&gt;- calculated from the above two: time period as UnixTime value&lt;/P&gt;
&lt;P&gt;- calculated: "Hours" per day&lt;/P&gt;
&lt;P&gt;- string value (cathegorical) "Group"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Goal:&lt;/P&gt;
&lt;P&gt;get a List of Days where each day contains:&lt;/P&gt;
&lt;P&gt;- the respective date&lt;/P&gt;
&lt;P&gt;- the "Hours per Day" value assigned to a field named after the Group&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Intention:&lt;/P&gt;
&lt;P&gt;create a vizualisation showing what group is needed how much at what time&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 15:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607711#M211317</guid>
      <dc:creator>Finn</dc:creator>
      <dc:date>2022-08-01T15:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Distribute a value form an event over a given time period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607719#M211320</link>
      <description>&lt;P&gt;Can you share some sample events - preferably in a code block &amp;lt;/&amp;gt; (rather than paragraph text or graphic) as it makes it easer to replicate your usecase, and suggest a solution?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 09:01:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607719#M211320</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-01T09:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Distribute a value form an event over a given time period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607720#M211321</link>
      <description>&lt;P&gt;Sure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This would be the data i am working with:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "Stunden":  3,
    "Gruppe":  "WST-M",
    "DatumStart":  "2022-07-08 00:00:00",
    "DatumEnde":  "2022-08-31 00:00:00",
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;These are all the relevant fields i am working with.&lt;/P&gt;&lt;P&gt;I already wrote SPL to extract the Unix Times, calculate the duration of the operation and divide the "Stunden" by this duration.&lt;/P&gt;&lt;P&gt;Since alle field names are in german, I will provide some translations below (ignore if not needed)&lt;/P&gt;&lt;P&gt;Stunden - hours&lt;/P&gt;&lt;P&gt;Gruppe - group&lt;/P&gt;&lt;P&gt;Datum - Date&lt;/P&gt;&lt;P&gt;Start - start&lt;/P&gt;&lt;P&gt;Ende - end&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 09:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607720#M211321</guid>
      <dc:creator>Finn</dc:creator>
      <dc:date>2022-08-01T09:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Distribute a value form an event over a given time period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607731#M211323</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="{
    \"Stunden\":  3,
    \"Gruppe\":  \"WST-M\",
    \"DatumStart\":  \"2022-07-08 00:00:00\",
    \"DatumEnde\":  \"2022-08-31 00:00:00\",
}"
| spath
| eval DatumStart = strptime(DatumStart,"%F %T")
| eval DatumEnde = strptime(DatumEnde,"%F %T")
| eval duration = DatumEnde-DatumStart
| eval days = floor(duration/86400)
| eval hoursPerDay = Stunden/days
| eval day = mvrange(0,days)
| mvexpand day
| eval _time = DatumStart+(day*86400)
| timechart sum(hoursPerDay) by Gruppe&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 01 Aug 2022 12:12:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607731#M211323</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-01T12:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Distribute a value form an event over a given time period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607764#M211333</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;"You're simply the best" - Tina Turner&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 01 Aug 2022 13:27:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-distribute-a-value-form-an-event-over-a-given-time-period/m-p/607764#M211333</guid>
      <dc:creator>Finn</dc:creator>
      <dc:date>2022-08-01T13:27:19Z</dc:date>
    </item>
  </channel>
</rss>

