Ideally splunk has created two fields - date_month
and date_year
. If these fields are present then you can use below stats command-
...| stats count by date_month, date_year
The solution provided worked out
Ideally splunk has created two fields - date_month
and date_year
. If these fields are present then you can use below stats command-
...| stats count by date_month, date_year
@sudeep5689, I am converting my comment as Answer. Please accept this if it helps.
You can create two separate panel and run each panel query on separate timerange in single dashboard.
i want the results in same panel
you can use earliest and latest within your query to run on separate timerange like below example-
index=abc earliest=-1d@d latest=now() |<your calculation>|append [search index=abc earliest=-5d@d latest=now()]
Ok
Can we show the results as separate rows using this combined search. i mean month wise
like count of events i need to show on a monthly basis
you can show count on a monthly basis using single query . Is there any other reason for running two query?
in a single query using append right or anyother way you are hinting at
yes need to show comparison across months for count basis.