Graylog Problems with create alert notifications - graylog2

I create alerts with this topic
But I dont understand why some information dont send. Like this variable ${message.fields.name} and another similar.
This is my Conditions
I used this template
Date: ${check_result.triggeredAt}
Stream ID: ${stream.id}
Stream title: ${stream.title}
${if stream_url}Stream URL: ${stream_url}${end}
${if backlog}Last messages accounting for this alert:
${foreach backlog message}
Message: ${message.message}
Source: ${message.source}
Full Message: ${message.fields.full_message}
${end}${else}<No backlog>
${end}
And have this in my mail
##########
Alert Description: Dummy alert to test notifications
Date: 2017-09-11T18:48:33.664Z
Stream ID: 59b695542ab79c0001554b85
Stream title: New Stream
Stream description: Test notifications
Alert Condition Title: Test Alert
Stream URL: https://mysite
Triggered condition: d91e0fa5-867c-4cf1-bf0e-2b5d2fdd19f9:dummy={Dummy alert to test notifications}, stream:={59b695542ab79c0001554b85: "New Stream"}
##########
Message: Full Message:
How create this notifications?

I dont know how, but now its work.
${if backlog}
You have new request:
${foreach backlog message}
status: ${message.fields.status}
firstname: ${message.fields.name_first}
lastname: ${message.fields.name_last}
phone: ${message.fields.phone}
email: ${message.fields.email}
source: ${message.fields.source}
timestamp: ${message.fields.timestamp}
${end}
${else}
Empty backlog
${end}

Related

How to trigger intent after clicking on carousel item?

This is something that is confusing me. So, I have the following carousel with three items:
//This is my test Carousel
function googleAssistantOther1(agent){
let conv = agent.conv();
conv.ask('Please choose an item');
conv.ask(new Carousel({
title: `All Items`,
items: {
'WorksWithGoogleAssistantItemKey1':{
title: `My Message`,
description: `No description required`,
image:{
url: 'https://i.imgur.com/sdUL0T7.png',
accessibilityText: `item1`,
},
},
'GoogleHomeItemKey1': {
title: `Test1`,
description: `blah blah`,
image: {
url: 'https://i.imgur.com/sdUL0T7.png',
accessibilityText: `item2`,
},
},
'SomeRandomKey1':{
title: `Test2`,
description: `blah blah blah`,
image: {
url: 'https://i.imgur.com/sdUL0T7.png',
accessibilityText: `item3`,
},
},
},
}));
// Add Actions on Goole responses to your agent's response
agent.add(conv);
}
When I test it in Actions on Google Simulator, it is working perfectly. However, when I click on the carousel item (say first one) it does not trigger the intent associated with the title. For example, in Simulator if I type "My message" the intent will be triggered but when I click on the carousel item with the same title "My message" the following happens:
So my question is how can I trigger "My message" intent by clicking on carousel item. Any solution or suggestion would be appreciated.
When a list carousel card(or item) is tapped, it generates an event that will hit your webhook, unlike the simple text message.
1st way (if your webhook handling the response)
So you need to handle it in your code.
Generally, it should have intent as actions_intent_OPTION. from there you need to segregate it.
2nd way (if your code is not handling the response)
In this way, your intent must be able to handle actions_intent_OPTION event generated by the carousel(or list).
for that, your intent need to add the event as shown in below image (Basically it tells the dialogflow that whenever the actions_intent_OPTION events triggered, this intent is capable to handle it, but currently in your case, no intent matches the description and it's going to Default Fallback Intent)
So whenever the list item tapped it can handle the flow.
For more refer this documentation.

Unable to execute LUIS Action Binding (Nodejs)

I am making a service Bot. In the intent 'CustomerSatisfaction', I want 'rating' and 'future' as my mandatory entities and 'timetaken' as my optional entity. I have taken the format from internet and modified it according to my use case.
Issue:
I am not able to understand that how should I integrate this with my Bot's code, so that it could be executed. So, when I ask 'How did you like the service?', it goes to 'CustomerSatisfaction', intent and do not proceed further till user answers 'Please provide the rating out of 5 for this bot.', 'Please provide the rating out of 5 for this bot.' and where timetaken entity is optional.
link to which I have referred.
Here is the modified code according to my use case I want to integrate with my Bot's code. :
var CustomerSatisfactionAction = {
intentName: 'CustomerSatisfaction',
friendlyName: 'Customer Satisfaction',
confirmOnContextSwitch: true, // true by default
// Property validation based on schema-inspector -
https://github.com/Atinux/schema-inspector#v_properties
schema: {
rating: {
type: 'any',
rating : rating ,
message: 'Please provide the rating out of 5 for this bot.'
},
future: {
type: 'string',
future : future ,
message: 'Please provide the rating out of 5 for this bot.'
},
timetaken: {
type: 'string',
optional: true
},
},
// Action fulfillment method, recieves parameters as keyed-object
(parameters argument) and a callback function to invoke with the fulfillment
result.fulfill: function (parameters, callback)
{
session.send ('ok');
}

I'm trying to make sense of session, but cannot get any data out of it

Currently using LUIS in a bot that connects to Slack. Right now I'm using interactive messages and trying to respond to user input correctly. When I click an item from the drop down LUIS receives it as a message. I can get the text with session.message.text, however I need to get the callback_id of the attachment as well as the channel it was sent from.
I've used console.log(session) to get an idea of what session looks like. From there I've seen that session.message.sourceEvent contains the data I need, however I can't use indexOf() or contains() to actual extrapolate the data. I've also tried session.message.sourceEvent.Payload but end up getting "[object [Object]]". I've tried searching for documentation on session formatting but to no avail.
Below is a snippet of what is returned when I run console.log(session.message.sourceEvent).
{ Payload:
action_ts: '1513199773.200354',
is_app_unfurl: false,
subtype: 'bot_message',
team: { id: 'T03QR2PHH', domain: 'americanairlines' },
user: { id: 'U6DT58F2T', name: 'john.cerreta' },
message_ts: '1513199760.000073',
attachment_id: '1',
ts: '1513199760.000073' },
actions: [ [Object] ],
callback_id: 'map_selection1',
original_message:
username: 'Rallybot',
response_url: 'https://hooks.slack.com/actions/T03QR2PHH/287444348935/Y6Yye3ijlC6xfmn8qjMK4ttB',
type: 'message',
{ type: 'interactive_message',
channel: { id: 'G6NN0DT88', name: 'privategroup' },
token: 'removed for security',
{ text: 'Please choose the Rally and Slack team you would like to map below.',
bot_id: 'B7WDX03UM',
attachments: [Array],
trigger_id: '285857445393.3841091595.085028141d2b8190b38f1bf0ca47dd88' },
ApiToken: 'removed for security' }
session.message.sourceEvent is a javascript Object, however indexOf or contains are functions of String or Array types.
Any info you required in the object, you should direct use the code <object>.<key> to invoke that value. You can try session.message.sourceEvent.Payload.action_ts for example.
Also, you can use Object.keys(session.message.sourceEvent) to get all the keys in this object.

displaying custom error messages in stripecheckout.js

I am using stripecheckout.js for handling payments on my site.
I am configuring the object to be send to the stripe pop up as:
stripeHandler = StripeCheckout.configure({
key: $scope.stripeKey,
image: 'img/logo.png',
locale: 'auto',
panelLabel: 'Pay',
color: 'black',
token: handleToken
});
where handleToken is my callback.
Opening the stripe pop up as :
stripeHandler.open({name: //some name,
description: //some description,
amount: //some amount,
currency: //some currency
});
Now I want to display error custom messages related to expiry and cvv fields.
How do I have to pass these messages inside stripe popup.
You can't. Checkout has a number of configuration options, but it is not possible to customize the error messages.
If Checkout supports your language, you can use the data-locale attribute to force a specific language, or set it to auto to use the customer's preferred language automatically.

node-slack outgoing web-hook is missing the trigger property

My current hook that my application receives from slack looks like the following. Missing the trigger_word property.
{
token: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX',
team_id: 'XXXXXXXXXXX',
channel_id: 'XXXXXXXXX',
channel_name: 'channel',
timestamp: Invalid Date,
user_id: 'XXXXXXX',
user_name: 'user',
text: 'massive string'
}
The text property can be extrapolated to figure what the trigger value but this seems like a bit of a hassle. How can I make it so that it has the trigger_word as shown in the documentation?
The req.body had all the properties, but the node-slack module parsed through the hook and filtered out some useful ones.

Resources