Splunk panel showing graph for a specific time range - monitoring

I am working with splunk. I want to pull logs for an api call for a specific range of time 9.30pm to 12:00 am on daily basis. Also, the average time taken for the call duraing that specific duration.
index="index_a" sourcetype="pqr" source="prq_source" "Success in api response"
Can someone guide me how to handle this how we can fetch for that particular duration for atleast 7 days.

Something like this should work (so long as you have the automatic field date_hour created by Splunk):
index="index_a" sourcetype="pqr" source="prq_source" "Success in api response" earliest=-7d
| where (date_hour>=21 AND date_minute>=30) OR date_hour>=22
| stats avg(call_duration) as avg_call by success_id
If date_hour & date_minute aren't being automatically supplied by Splunk, you can create them yourself with strftime:
| eval date_hour=strftime(_time,"%H"), date_minute=strftime(_time,"%M")

Related

Google sheets find from named range a specified date&time display description from that named range

I'm writing a schedule for my wife and I in Google Sheets that seemed to be working but is missing some of our scheduled meetings/appointments. A link to an exact copy is found here.
The idea is that within the "Event Scheduler" I can list in DATE | TIME | DESCRIPTION and it generates a UNIQUE ID using =V14&"|"&COUNTIF(V$14:V14,V14) and also generating a DATE&TIME using DATE&TIME format. I highlight each person (or animal)'s scheduled items in named ranges named "MolliesEvents", "AydensEvents" and "DogsEvents". I now go to the main page, "Daily + Weekly" and compared the current date TODAY() and the time in the E column to the DATE&TIME column of the "Event Scheduler" sheet. Weirdly, this works for some of the scheduled items. However, a significant minority is not captured by the code that I've used. Weirder still, when I compared manually the time in the "Event Scheduler" with the time and date on the "Daily + Weekly" page I get a positive result. However, when I attempt to automate this process it does not.
You are losing events due to rounding.
For example, consider the event "Monday, March 22, 2021 11:30:00 Doctor calling".
In the 'Event Scheduler'!F18 cell is 442770.479166666666667.
In the 'Daily + Weekly'!F14 cell, you use TODAY()&E14 = 442770.479166666666666 in the formula.
Due to the fact that 442770.479166666666667 does not equal 442770.479166666666666, this event does not hit the sheet. This also applies to other lost events.
Possible Solution.
Delete the 'Time Intervals' sheet and enter the time manually on the 'Daily + Weekly' sheet in column E.
Also, I would change the formula like this:
=IFERROR(INDEX(MolliesEvents, MATCH(TODAY()&E14, 'Event Scheduler'!$F$14:$F$1000,0),3),"") (this is in the F14, copy it to other cells).
Here's an example of a spreadsheet that works well.

Change Amazon Lex Chat bot Time zone

Now,I am integrating my amazon Lex chat bot to my web. I got the time zone issue. Time zone is in US East (N. Virginia). So if I say today, that is based on Virginia time. So I find how to change time zone and the suggestion is to set the x-amz-lex:time-zone request attribute to my region. but I donot know how to do and where to do. PLs help me!! Thanks.
I used simple Template "https://s3.amazonaws.com/aws-bigdata-blog/artifacts/aws-lex-web-ui/artifacts/templates/master.yaml".
I copied the codes from SnippetUrl and paste to my web page. The Chat Bot appear. So how should I pass these request attribute.
this this my chat bot in amazon lex
this is my cloud formation
These codes are from SnippetUrl in CodeBuildDeploy
There may be an option in the template you are using but I can't find it, so here is what you need to know about setting timezones in Lex.
First of all, the only way to change the timezone from the default East US is to use PostContent API or PostText API. They should really have a timezone setting in the Lex Console so you can set the default timezone at least, but they don't.
The correct way:
The AWS SDK is needed to use PostContent API or PostText API to pass the user's input to your Lex chat bot. When passing data to Lex this way, you can include requestAttributes with the user's input, unique ID and session attributes (optional). Here's an example of how you would set the timezone in requestAttributes to Singapore Time:
{
"inputText": "What the user said.",
"requestAttributes": {
"x-amz-lex:time-zone" : "Singapore"
},
"sessionAttributes": null
}
The workaround:
If you cannot use or cannot access the use of PostContent or PostText, then you need to work with what you have. Right now, it looks like you are only using a Lambda function for fulfillment, but you should really also use it for "initialization and validation" too.
This will pass a request to your Lambda function every time Lex processes an input and you can direct Lex with exactly how to reply. This gives you much greater control of your chat bot.
To understand the format of the Request (sometimes called "Event") and how to format the Response in that Lambda function, you will want to read these docs.
Now, Lex processes the date and time from the user's input...(In your example, the user says "today")...and Lex will fill the date or time slots with something like (date) 2018-11-02 (time) 13:00 which will be appropriate for Eastern Standard Time (UTC -5). But Singapore is UTC +8. So you will need to convert that date and time in your Lambda function and overwrite the slots to the equivalent Singaporean time then pass those slots back in your Lambda's response to Lex.
There are multiple ways to do that conversion depending on whether your Lambda is in Node.js or Python and plenty of answers and guides on timezone conversion.
Example:
User Input: "I want to book a meeting room from 1pm to 2pm for today"
To capture the values of this input, your Intent should be set up with something like:
3 slots: {date} {time_start} {time_end}
Intent Utterance: "I want to book a meeting room from {time_start} to {time_end} for {date}"
Lex will then parse the input and fill the slots (using timezone default: East US). Then Lex will pass the request to your "initialization and validation" Lambda Function. The request (or "event") will include:
{
"currentIntent": {
"name": "BookRoom",
"slots": {
"date": "2018-11-05",
"time_start": "13:00",
"time_end": "14:00",
},
},
...
}
Then in the Lambda Function you can take those values (Node.js):
var date = event['currentIntent']['slots']['date'];
var time_start = event['currentIntent']['slots']['time_start'];
var time_end = event['currentIntent']['slots']['time_end'];
Now for your conversion logic:
Since Singapore is 13 hours ahead of East US, just take those times and add 13 hours to them. If when doing that, it passes midnight, then also increase the date by 1 day.
This will work for inputs of "today", "tomorrow", "next tuesday", or even "25 Jan 2035", because Lex parses all of those the same way and simply delivers them to your Lambda in default East US time formatted as (date) yyyy-mm-dd and (time) hh:mm.
After you convert them, just set those slots as the new date and times, then pass the slots back to Lex in your response. Lex will then hold the slot values in Singapore time.
This is the solution image
Finally, I got the solution. If someone want to know the solution check in the photo. I just try to fix the codes from aws github. Thanks.

Microsoft Graph get calendar entries happening today (reaching over timeframe)

I'm currently struggeling with the Microsoft Graph REST-API.
What I'm trying to do is list todays events (happening between midnight and midnight). From the documentation, the filter function is very limited.
My current statement looks like this:
https://graph.microsoft.com/v1.0/me/events?$top=100&$select=*&$filter=start/DateTime ge '2017-10-31T00:00:00' AND end/DateTime le '2017-11-1T00:00:00'&$orderby=start/DateTime ASC
The interesting part is here $filter=start/DateTime ge '2017-10-31T00:00:00' AND end/DateTime le '2017-11-1T00:00:00' using the start and the end and checking if start >= TODAY AND end <= TODAY+1. That's all working great for dates that are shorter as 1 day.
My problem is now how to get events that last longer than one day e.g. start = YESTERDAY and end = NEXT WEEK. Which means the start date is before today and the end day is as well not included in this range.
How to get this events?
I believe you should be using Calendar View for your scenario:
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/calendar_list_calendarview
The link that Yogesh referenced seems to be removed and not found. Here is the link that I used which shows how to use the calendar view. Hopefully this helps -- https://learn.microsoft.com/en-us/graph/api/calendar-list-calendarview?view=graph-rest-1.0&tabs=http

How to show "33 minutes ago" on Grafana dashboard with InfluxDB?

I have recently set up Grafana with InfluxDB. I'd like to show a panel that indicates how long it has been since an event took place.
Examples:
Server last reported in: 33 minutes ago
Last user sign up: 17 minutes ago
I can get a single metric pretty easily with the following code:
SELECT time, last("duration") as last_duration FROM custom_events ORDER BY time DESC
But I can't seem to get Grafana to do what I want with the time field.
Any suggestions?
Since Grafana(4.6.0) this is now possible with singlestat panels.
GoTo the Options-Tab
Select Value -> Stat -> Time of last point
Select Value -> Stat -> Unit -> Date & time -> From Now
Its currently(4.0.3) not possible to show the last timestamp in singlestat panels. But there is an issue for supporting this. Hopefully we will find time to implement this in the future.
In 8.4.0 There is a unit selection that allows you to do this, make sure your timestamp is in milliseconds since the epoch and select From Now as the unit in the dropdown menu
singlestat pannel expressing time since

Jira JQL decode Monday Tuesday etc

Has anyone managed to create a query that returns data based on Monday Tuesday Wednesday next week?
I can get a result with startofweek(1) and endofweek(1) but that doesn't break down to each day.
Ideally I'd get a result like this:
Monday | Tuesday | Wednesday | Thursday | Friday |
--------------------------------------------------
Card1 Card1
Card3 Card4
Card5
Any help would be appreciated.
I believe that is not possible. Columns on Jira boards are configurable by issue status, not via JQL. However, you could do the following:
1) Add a quickfilter for each weekday. JQL actually is more powerful as it looks on first sight: You can use expressions like "status changed ON ..." - enabling you to observe issues that were touched at these days. This would per filter show a single day only on the board, since filters are internally combined via AND.
2) Do the same JQL but with swim lanes. You could see each day on the board at the same time in a separate swimlane. But I consider this mind-twisting.
You should write a more elaborate JQL that fits what exactly you want to see, of course. There is another way, though you'd need (low) programming skills:
3) Use Jira REST API to fetch your sprint/week data and throw it in a grid that suits your needs yourself.

Resources