Splunk Dev

financial Calendar

DanielaEstera
Explorer

Hi, community members

 

I am trying to write a query that looks like this:

| dbxquery query="select VULNERABILITY_LIFECYCLE, SOURCE, CLOSURE_FY, CLOSURE_QUARTER, CLOSURE_DATE
from table [...]"
| eval MONTH=strftime(strptime(CLOSURE_DATE,"%Y-%m-%d %H:%M:%S"),"%m")
| eval SURSA = if(SOURCE!="QUALYS-P","Confirmed", "Potential")
| chart count over MONTH by SURSA

 

My problem is that I want this chart to represent a financial year, not a calendar year. How can I do this? (also,  without skipping months)

DanielaEstera_0-1632391869249.png

 

Thank you for your support,

Daniela

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Include the year in the MONTH field? Add 8/subtract 4 (assuming April) and take a modulus 12 and add 1?

0 Karma

DanielaEstera
Explorer

not quite sure. did you mean :

| eval MONTH=strftime(strptime(CLOSURE_DATE,"%Y-%m-%d %H:%M:%S"),"%m-%Y")
| eval luna = (MONTH + 4 )mod 12 + 1

??

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The values will be sorted so year should come before month.

| eval MONTH=strftime(strptime(CLOSURE_DATE,"%Y-%m-%d %H:%M:%S"),"%Y-%m")

or change the month so the April is 1 and March is 12

| eval luna = ((MONTH + 8 ) % 12) + 1
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...