<?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 How can I take multiple fields and time values and combine them into one? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-take-multiple-fields-and-time-values-and-combine-them/m-p/431347#M75473</link>
    <description>&lt;P&gt;Suppose I have 4 fields &lt;/P&gt;

&lt;P&gt;fields= "jobtype"    values= A,B&lt;BR /&gt;
fields= "status"      values=1,2,3,4,5,6&lt;BR /&gt;
fields= "Time1"      values=.....................&lt;BR /&gt;
fields= "Time2"      values=.....................&lt;/P&gt;

&lt;P&gt;I want to create a full day timestamp using the fields I have &lt;/P&gt;

&lt;P&gt;(example)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Step 1 =    jobtype=A ,status=1 **earliest of Time1**       
Step 2 =    jobtype=A ,status=1 **latest of Time1**     
Step 3 =    jobtype=A, status=2 Or status=3 **earliest of Time2**       
Step 4 =    jobtype=A, status=2 Or status=4 **latest of Time2**     
Step 5 =    jobtype=B, status=5 **earliest of Time2**       
Step 6 =    jobtype=A, status=6 **earliest of Time2**   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result would look something like this on one sheet&lt;/P&gt;

&lt;P&gt;Step1---------- Step2------------ Step3---------  Step4------------ Step5---------- Step6   &lt;/P&gt;

&lt;P&gt;min(Time1) ---max( Time1)---min(Time2)-- max(Time2)----min(Time2)---min(Time2)&lt;/P&gt;

&lt;P&gt;Because There is multiple fields and values involved, I cannot seem to get the right answer. Please help me&lt;/P&gt;</description>
    <pubDate>Fri, 07 Dec 2018 15:48:57 GMT</pubDate>
    <dc:creator>hyungjoon</dc:creator>
    <dc:date>2018-12-07T15:48:57Z</dc:date>
    <item>
      <title>How can I take multiple fields and time values and combine them into one?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-take-multiple-fields-and-time-values-and-combine-them/m-p/431347#M75473</link>
      <description>&lt;P&gt;Suppose I have 4 fields &lt;/P&gt;

&lt;P&gt;fields= "jobtype"    values= A,B&lt;BR /&gt;
fields= "status"      values=1,2,3,4,5,6&lt;BR /&gt;
fields= "Time1"      values=.....................&lt;BR /&gt;
fields= "Time2"      values=.....................&lt;/P&gt;

&lt;P&gt;I want to create a full day timestamp using the fields I have &lt;/P&gt;

&lt;P&gt;(example)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Step 1 =    jobtype=A ,status=1 **earliest of Time1**       
Step 2 =    jobtype=A ,status=1 **latest of Time1**     
Step 3 =    jobtype=A, status=2 Or status=3 **earliest of Time2**       
Step 4 =    jobtype=A, status=2 Or status=4 **latest of Time2**     
Step 5 =    jobtype=B, status=5 **earliest of Time2**       
Step 6 =    jobtype=A, status=6 **earliest of Time2**   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result would look something like this on one sheet&lt;/P&gt;

&lt;P&gt;Step1---------- Step2------------ Step3---------  Step4------------ Step5---------- Step6   &lt;/P&gt;

&lt;P&gt;min(Time1) ---max( Time1)---min(Time2)-- max(Time2)----min(Time2)---min(Time2)&lt;/P&gt;

&lt;P&gt;Because There is multiple fields and values involved, I cannot seem to get the right answer. Please help me&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 15:48:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-take-multiple-fields-and-time-values-and-combine-them/m-p/431347#M75473</guid>
      <dc:creator>hyungjoon</dc:creator>
      <dc:date>2018-12-07T15:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I take multiple fields and time values and combine them into one?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-take-multiple-fields-and-time-values-and-combine-them/m-p/431348#M75474</link>
      <description>&lt;P&gt;Something like this? also it helps if you can share some mockup data or build it with makeresults . The only line below you should care about is xyseries I suspect. you may need a stats for this "max" requirement&lt;/P&gt;

&lt;P&gt;| makeresults count=2 &lt;BR /&gt;
| streamstats count as count &lt;BR /&gt;
| eval time=case(count=2,relative_time(now(),"+2d"),count=1,now()) &lt;BR /&gt;
| makecontinuous time span=15m &lt;BR /&gt;
| eval _time=time&lt;BR /&gt;
| eval job=if( random()%2==1,"JobA","JobB")&lt;BR /&gt;
| streamstats count by job reset_on_change=true &lt;BR /&gt;
| xyseries count, job, _time&lt;/P&gt;

&lt;P&gt;Alternatively you may mean (you only care about the |Stats and |xyseries parts )&lt;/P&gt;

&lt;P&gt;| makeresults count=2 &lt;BR /&gt;
| streamstats count as count &lt;BR /&gt;
| eval time=case(count=2,relative_time(now(),"+2d"),count=1,now()) &lt;BR /&gt;
| makecontinuous time span=15m &lt;BR /&gt;
| eval _time=time &lt;BR /&gt;
| eval job=if( random()%2==1,"JobA","JobB") &lt;BR /&gt;
| streamstats count by job reset_on_change=true &lt;BR /&gt;
| stats  max(_time) by count, job&lt;BR /&gt;
| xyseries job, count, max(_time)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:19:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-take-multiple-fields-and-time-values-and-combine-them/m-p/431348#M75474</guid>
      <dc:creator>astein_splunk</dc:creator>
      <dc:date>2020-09-29T22:19:06Z</dc:date>
    </item>
  </channel>
</rss>

