Splunk Cloud Platform

Unable to generate the result for Month of September manually?

chinmay25
Path Finder

I wish to generate the results for month of September. I am currently using the following query, however if i set the date range it doesnt generate results for September. We still see the data for October. 

 

index=XYZ source=XYZ (SMF30JBN=F*DC03D OR SMF30JBN=M*DC03D) (SMF30STP=1 OR (SMF30STP=4 AND SMF30STM=DOWNS020)) SMF30JNM=JOB* earliest=@d-48h latest=@d+6h
| eval ACTUAL_START = case(SMF30STP=1,DATETIME)
| eval ACTUAL_END = case(SMF30STP=4,DATETIME)
| stats values(ACTUAL_START) as ACTUAL_START values(ACTUAL_END) as ACTUAL_END by SMF30JNM SMF30JBN
| rename SMF30JBN as JOBNAME
| eval CYCLE = relative_time(now(),"@d-720m")
| eval WEEKDAY=strftime(CYCLE,"%A")
| eval CYCLE = strftime(CYCLE, "%Y-%m-%d %H:%M:%S.%2N")
| eval MONTH = substr(CYCLE,6,2)
| eval DAY = substr(CYCLE,9,2)
| eval YEAR = substr(CYCLE,1,4)
| eval DATE = substr(CYCLE,1,10)
| lookup workloadinfo.csv JOBNAME output WEEK_START WEEK_END WEEK_RT SAT_START SAT_END SAT_RT SYS STATES
| eval WEEK_START = case(WEEK_START="SLA0600",relative_time(now(),"@d-1080m"),WEEK_START="SLA0700",relative_time(now(),"@d-1020m"),WEEK_START="SLA1300",relative_time(now(),"@d-660m"),WEEK_START="SLA1400",relative_time(now(),"@d-600m"),WEEK_START="SLA1430",relative_time(now(),"@d-570m"),WEEK_START="SLA1600",relative_time(now(),"@d-480m"),WEEK_START="SLA1700",relative_time(now(),"@d-420m"),WEEK_START="SLA1730",relative_time(now(),"@d-390m"),WEEK_START="SLA1800",relative_time(now(),"@d-360m"),WEEK_START="SLA1830",relative_time(now(),"@d-330m"),WEEK_START="SLA1900",relative_time(now(),"@d-300m"),WEEK_START="SLA1930",relative_time(now(),"@d-270m"),WEEK_START="SLA2000",relative_time(now(),"@d-240m"),WEEK_START="SLA2100",relative_time(now(),"@d-180m"),WEEK_START="SLA2200",relative_time(now(),"@d-120m"))
| eval WEEK_END = case(WEEK_END="SLA0600",relative_time(now(),"@d-1080m"),WEEK_END="SLA0700",relative_time(now(),"@d-1020m"),WEEK_END="SLA1300",relative_time(now(),"@d-660m"),WEEK_END="SLA1400",relative_time(now(),"@d-600m"),WEEK_END="SLA1430",relative_time(now(),"@d-570m"),WEEK_END="SLA1600",relative_time(now(),"@d-480m"),WEEK_END="SLA1700",relative_time(now(),"@d-420m"),WEEK_END="SLA1730",relative_time(now(),"@d-390m"),WEEK_END="SLA1800",relative_time(now(),"@d-360m"),WEEK_END="SLA1830",relative_time(now(),"@d-330m"),WEEK_END="SLA1900",relative_time(now(),"@d-300m"),WEEK_END="SLA1930",relative_time(now(),"@d-270m"),WEEK_END="SLA2000",relative_time(now(),"@d-240m"),WEEK_END="SLA2100",relative_time(now(),"@d-180m"),WEEK_END="SLA2200",relative_time(now(),"@d-120m"))
| eval SAT_START = case(SAT_START="SLA0600",relative_time(now(),"@d-1080m"),SAT_START="SLA0700",relative_time(now(),"@d-1020m"),SAT_START="SLA1300",relative_time(now(),"@d-660m"),SAT_START="SLA1400",relative_time(now(),"@d-600m"),SAT_START="SLA1430",relative_time(now(),"@d-570m"),SAT_START="SLA1600",relative_time(now(),"@d-480m"),SAT_START="SLA1700",relative_time(now(),"@d-420m"),SAT_START="SLA1730",relative_time(now(),"@d-390m"),SAT_START="SLA1800",relative_time(now(),"@d-360m"),SAT_START="SLA1830",relative_time(now(),"@d-330m"),SAT_START="SLA1900",relative_time(now(),"@d-300m"),SAT_START="SLA1930",relative_time(now(),"@d-270m"),SAT_START="SLA2000",relative_time(now(),"@d-240m"),SAT_START="SLA2100",relative_time(now(),"@d-180m"),SAT_START="SLA2200",relative_time(now(),"@d-120m"))
| eval SAT_END = case(SAT_END="SLA0600",relative_time(now(),"@d-1080m"),SAT_END="SLA0700",relative_time(now(),"@d-1020m"),SAT_END="SLA1300",relative_time(now(),"@d-660m"),SAT_END="SLA1400",relative_time(now(),"@d-600m"),SAT_END="SLA1430",relative_time(now(),"@d-570m"),SAT_END="SLA1600",relative_time(now(),"@d-480m"),SAT_END="SLA1700",relative_time(now(),"@d-420m"),SAT_END="SLA1730",relative_time(now(),"@d-390m"),SAT_END="SLA1800",relative_time(now(),"@d-360m"),SAT_END="SLA1830",relative_time(now(),"@d-330m"),SAT_END="SLA1900",relative_time(now(),"@d-300m"),SAT_END="SLA1930",relative_time(now(),"@d-270m"),SAT_END="SLA2000",relative_time(now(),"@d-240m"),SAT_END="SLA2100",relative_time(now(),"@d-180m"),SAT_END="SLA2200",relative_time(now(),"@d-120m"))
| eval EXP_START = if(WEEKDAY="Saturday" OR WEEKDAY="Sunday",SAT_START,WEEK_START)
| eval EXP_END = if(WEEKDAY="Saturday" OR WEEKDAY="Sunday",SAT_END,WEEK_END)
| eval RUNTIME = if(WEEKDAY="Saturday" OR WEEKDAY="Sunday",SAT_RT,WEEK_RT)
| eval ACTUAL_START = strptime(ACTUAL_START, "%Y-%m-%d %H:%M:%S.%2N")
| eval ACTUAL_END = strptime(ACTUAL_END, "%Y-%m-%d %H:%M:%S.%2N")
| eval STARTC = case(ACTUAL_START < EXP_START AND ACTUAL_END > EXP_START, EXP_START,ACTUAL_START > EXP_START,ACTUAL_START,(ACTUAL_START < EXP_START AND ACTUAL_END < EXP_START),null(),(ACTUAL_START > EXP_END AND ACTUAL_END > EXP_END),null())
| eval ENDC = case(ACTUAL_END > EXP_END AND ACTUAL_START < EXP_END, EXP_END, ACTUAL_END < EXP_END,ACTUAL_END,(ACTUAL_START < EXP_START AND ACTUAL_END < EXP_START),null(),(ACTUAL_START > EXP_END AND ACTUAL_END > EXP_END),null())
| eval DURATION =(ENDC-STARTC)/60
| eval ACTUAL_START = strftime(ACTUAL_START, "%Y-%m-%d %H:%M:%S.%2N")
| eval ACTUAL_END = strftime(ACTUAL_END, "%Y-%m-%d %H:%M:%S.%2N")
| eval EXP_START = strftime(EXP_START, "%Y-%m-%d %H:%M:%S.%2N")
| eval EXP_END = strftime(EXP_END, "%Y-%m-%d %H:%M:%S.%2N")
| eval STARTC = strftime(STARTC, "%Y-%m-%d %H:%M:%S.%2N")
| eval ENDC = strftime(ENDC, "%Y-%m-%d %H:%M:%S.%2N")
| eval DURATION =if(DURATION < 0,0,DURATION)
| eval DURATION = round(DURATION,2)
| stats values(ACTUAL_START) as ACTUALSTART values(ACTUAL_END) as ACTUALEND values(EXP_START) as EXPSTART values(EXP_END) as EXPEND latest(STARTC) as CALCSTART latest(ENDC) as CALCEND sum(DURATION) as AVAILABILITY values(RUNTIME) as EXPRUNTIME values(WEEKDAY) as WEEKDAY values(MONTH) as MONTH values(DATE) as DATE values(SYS) as TYPE values(STATES) as CONTRACTOR values(YEAR) as YEAR values(DAY) as DAY by JOBNAME
| eval DOWNTIME = round(abs(AVAILABILITY - EXPRUNTIME),2)
| eval SLA_PERC = round(((AVAILABILITY / EXPRUNTIME) * 100),2)
| eval AVAILABILITY = if(SLA_PERC > 100, ((AVAILABILITY)-(EXPRUNTIME)), AVAILABILITY)
| eval SLA_PERC = if(SLA_PERC > 100, ((SLA_PERC)-100), SLA_PERC)
| eval WORKLOAD = substr(JOBNAME, 1, 3)
| fields *

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The time picker is being overridden by the earliest and latest settings in the base search.  There should be a message to that effect in the Job Inspector.

---
If this reply helps you, Karma would be appreciated.
0 Karma

chinmay25
Path Finder

I tried removing the earliest and latest setting in the base search and it still would not give me results for Sept. It is showing for Oct.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...