S_dharanidhar7
4 years agoNew Contributor
How to capture the log information in database for pipelines using snaplogic
Hi Team,
how to capture the the pipleine logging information into database.
please suggest a pipeline pattern or share sample pipeline.
Regards,
Dharanidhar
Hi @JensDeveloper,
It can be achieved in two ways-- You can use a unlinked (no input/open input) mapper as you first snap. (Hope you are sending json data only. )
Then whatever payload you are sending from client it can be accessible in mapper. Let say you are sending a payload like- [{“name”:“Supratim”,“lname”:“Das”},{“name”:“Supratim2”,“lname”:“Das”}] , you will get response like [{“name”:“Supratim”},{“name”:“Supratim2”}]. Please refer below two pics.
One more important thing when you use open mapper then you need to pass Content-Type as “application/json” from HTTP header.
In Pipeline-
Response from postman
- Rather having open mapper view, you can use JSON parser (If you are sending JSON, Incase of XML you have to start with unlinked XML parser.) then rest of the part remain same. In this you can ignore to pass Content-Type from header. This option we can choose where we are using json schema to validate any complex json payload before processing.
For both the case, if you want to capture entire payload, you can use “$” instead of $name.
- You can use a unlinked (no input/open input) mapper as you first snap. (Hope you are sending json data only. )