AWS Elasticsearch- Accessing ctx in Kibana Alerting - aws-elasticsearch

Is there way to get message in ctx?

After digging found that result is stored ctx.results

Related

Azure Data Factory Webhook body problems

So I'm experiencing some issues in Azure Data Factory.
I have a standard pipeline where I'm trying to implement a webhook for later callbacks, but the body for the webhook post does not seem to be behaving.
(In advance: sorry for the image URLs -> I'm not reputable enough to post images)
So here is what I've typed into the "Body" of the Webhook service: https://imagizer.imageshack.com/img922/3765/ApbiRN.jpg
Then I verify that the template looks correct:
https://imagizer.imageshack.com/img924/5448/vN82Vp.jpg
And finally I debug the pipeline only to find this as output from the webhook: https://imagizer.imageshack.com/img923/3697/AEDzOT.jpg
As you can see it's grabbing a {"Key":"Value"} from somewhere.
Now I've saved the pipeline; I've published the pipeline; I've restarted ADF.. Still.
So the first issue is that I'm not able to send the body that I want.
The second issue is that I'd like to parameterize the body (when this is cleared up):
{
"key1":"#{pipeline().parameters.param1}",
"key2":"#{pipeline().parameters.param2}",
"key3":"#{pipeline().parameters.param3}"
}
I've not been able to solve that last one either, so if any kind souls would be so kind.. much obliged!
Edit: In addition I've not been able to spot the "callBackUri" that the documentation promises: https://learn.microsoft.com/en-us/azure/data-factory/control-flow-webhook-activity
Any insights into that issue as well?
I tried many times and finally succeeded.
In your case, you can use the expression as follow:
#json(concat(concat('{"key1":"',pipeline().parameters.param1,'",'),concat('"key2":"',pipeline().parameters.param2,'",'),concat('"key3":"',pipeline().parameters.param3,'"}')))
The result is as follow:
First, we need to concatenate the query string.
Then we need to use #json() to convert the string type to json type.

Azure Data Factory - Error creating a parameterised mapping dataflow

I am having an error when trying to create a parameterised Mapping Data Flow. More specifically, I have the following error. Anyone have suggestions on how to fix it or what the error may be?
{ "Message": "ErrorCode=InvalidTemplate, ErrorMessage=Unable to parse expression 'body('DataFlowDebugExpressionResolver')?.Data Vault Loadb734571b6d5a414ea8387a08077f1ff1?.DataVaultSource.sourcetable': expected token 'EndOfData' and actual 'Identifier'." } - RunId: 24ee9884-610d-4061-a9be-670aeb8f1660
Thanks #Leon and #Joel for your responses. I am attaching my pipelines here for your consideration
[1
I have found the resolution to the problem I raised yesterday. The error was caused by the name of the Mapping Data Flow (Data Vault Load).
I raised a request from Microsoft and they had the following suggestion
Spaces in name of object and parameters does not go well
Once I removed the spaces in my Mapping Data Flow name it, this particular error was resolved.
Thanks to everyone that responded.
I have been looking for going around looking for this answer it is 2021 and Microsoft still didn't add any validation or restriction for the naming of the Data Flow

How to add Message Attributes to SNS Publish from API Gateway Integration Request

I can find formats for this using the CLI
aws sns publish --topic-arn arn:aws:sns:us-west-2:111111111111:test
--message "Testing the CLI"
--subject "From the CLI" --message-attributes "{\"somename\":
{\"DataType\":\"String\",\"StringValue\":\"somevalue\"}}"
But what I can't find (or figure out) is how to do this from the Integration Request on an API Gateway.
I believe it needs to be done as Query Parameters of the Integration Request, but the syntax is not the same as adding Message Attributes for SQS. I tested that by using a parameter naming notation along the lines of this example:
MessageBody=This+is+a+test+message
MessageAttribute.1.Name=test_attribute_name_1
MessageAttribute.1.Value.StringValue=test_attribute_value_1
MessageAttribute.1.Value.DataType=String
I also tried:
MessageAttributes '{"store":{"DataType":"String","StringValue":"example_corp"}}'
So far can't get it working, any help is much appreciated.
After thorough research into the AWS docs, I found that there is no accurate documentation of setting up SNS Publish MessageAttributes in an API Gateway Resource Method as URL Query String Parameters.
Based on the partial syntax example they give here: https://docs.aws.amazon.com/sns/latest/api/API_Publish.html, I was then able to throw things at it until something stuck.
This is the proper dot notation syntax and parameters you need to use:
MessageAttributes.entry.1.Name = "Attribute1"
MessageAttributes.entry.1.Value.DataType = 'String'
MessageAttributes.entry.1.Value.StringValue = 'Test'
Where "Name" and "DataType" are required.
Cheers!

Restheart: mongodb thgourh http get returns 404

I have managed to access a static url but when it comes to accessing an existing collection in mongodb (2.6) through a browser (e.g., http://0.0.0.0:8080/test/test) it returns a 404. Anybody knows if I have to add anything to the default configuration.yml to activate mongo access?
Thanks for help!!
First make sure it is RESTHeart responding you request:
if it is running on your pc, try 127.0.0.1:8080/test/test (not 0.0.0.0)
Also note that in case of 404, you should get a hal+json document with a "message" property (with somenthing like "the db test does bot exist").
If it is restheart, then either the db "test" or the collection "test/test" does not exist an you have to create them first.
If restheart coudn't connect with mongodb you would get "400 Internal Server Error" response code.
Finally I managed to find what the problem was by myself. I post the answer in case it's helpful for somebody else. Thanks Andrea for the help in any case :)
In the static-resources-mounts I had "where: /", which seemed to collide with the mongo-mounts default own "where: /". By changing either where value the access to mongodb retrieves a correct hal+json.

Apigility content validator - enable to fetch service validator

I was following the tutorials on https://apigility.org/documentation/content-validation/basic-usage. But, when I tried to inject the input filter service AddressBook\V1\Rest\Contact\Validator in the ContactResource, I get the following error:
Zend\ServiceManager\Exception\ServiceNotFoundException
File:
/Users/.../src/apigility-tutorials/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:529
Message:
Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for AddressBook\V1\Rest\Contact\Validator
I am not sure if it's an issue with apigility itself, this is why i'm asking if the example shown in the link above actually works when using dependency injection. Thanks
Got it. According to the zf-content-validation doc, the input filter is registered through Zend\InputFilter\InputFilterPluginManager which means I have to get the InputFilterManager service first then get the Contact input filter service as follows:
$inputFilter =
$serviceLocator->get('InputFilterManager')
->get('AddressBook\V1\Rest\Contact\Validator');
Thanks for looking into it.