Masking json response payload - json

I want to know how can we create a REGEX to mask below value of content against Created By key in response received from REST API.
\\\"CreatedBy\\\":{\\\"content\\\":\\\"abcd#test.com\\\"}
So output which I am expecting is
\\\"CreatedBy\\\":{\\\"content\\\":\\\"****#****.***\\\"} OR
\\\"CreatedBy\\\":{\\\"content\\\":\\\"*************\\\"} which is getting logged in output logs.
The one which I created by taking reference of other
(?<=\\\\"CreatedBy\\\\": \s*{\\\\"content\\\\":\\\ "*)
but this is not working, can anybody help me on this

Related

Using JSON extractor inside a WHILE controller in JMETER

I want to get JSON response which appears after some time of running a sample till then it is null, after some time it gives a "filestore_id" that is some random number. I am enable to write the condition in while loop for the loop to run till there is no null in the JSON response and extract the filestore_id from the JSON response which can be then used in a sample outside of that while loop.enter image description here
The file store id for loop 1 gives null.After some loops it gives some id number when the total records=recordscompleted.
Attached screenshots
Attached screenshot
Attached screenshot
The "condition" would be a __jexl3() function like:
${__jexl3("${filestore_id}" == "null",)}
I cannot give you either JSON Path or JSON JMESPath Expression because you preferred to post your JSON response as the image, it could be something like:

Iterating through JSON format

i have the following problem: i am sending a JSON File from a webservice into a extension to Qlik Sense and i am getting the following response:
"{"rownumber":1,"ID":1}{"rownumber":2,"ID":2}"
The type of the response is string. My question is how can i change the format to iterate through each element of this.
I have already tried the JSON.parse(result) and JSON.stringify(result) functions but the result was nothing that i can work with. Last one changed the
result to:
"{"rownumber":1,"ID":1}{"rownumber":2,"ID":2}"

How do I parse a JSON from Azure Blob Storage file in Logic App?

I have a JSON file in Azure Blob storage that I need to parse and insert rows into SQL using the Logic App.
I am using the "Get Blob Content" and my first attempt was to then pass to "Parse JSON". It returns and error": InvalidTemplate. Unable to process template language expressions in action 'Parse_JSON' inputs at line '1' and column '2856'"
I found some discussion that indicated that the content needs to be converted to a string so I used "Compose" and edited the code as suggested to
"inputs": "#base64ToString(body('Get_blob_content').$content)"
This works but then the InvalidTemplate issue gets pushed to the Parse function and I get the InvalidTemplate error there. I have tried wrapping the output in JSON expression and a few other things but I just can't get it to parse.
If I take a sample or even the entire JSON and put it into the INPUT of the Parse function it works without issue but it will not accept the blob content as JSON.
The only thing I have been able to do successfully from blob content is to take it as a string and update a row in SQL to later use the OPENJSON in SQL...but I run into an issue there that is for another post.
I am at a loss of what to do.
You don't post much information about your logic app actions, so maybe you could refer to my flow design. I test with a json data with array.
The below is my flow picture. I'm not using compose action, and use decodeBase64(body('Get_blob_content')['$content']) as the Parse Json content.
And if select property from the json, you need set the array index. I set a variable to get a value 'body('Parse_JSON')1['name']'.
you could have a try with this, if still fail, please provide more information or some sample to let us have a test.

JIRA API POST jql search

I need to get a bulk of issues that in the array of keys.
A GET URL-request like '...&issues in (key-1,key-2)...' is not an option for me because of length of the array may be more than 200 so it will be a 2000+ chars URL request and it is not good as I red here.
Here is Jira's API example but there is no comments about the jql property value format.
How should I fill the JSON-POST-model's jql property for get issues by keys?
You pass the jql as part of the request body. Here's a sample request body you can use for the /search endpoint using POST:
{
"jql": "status in (Done, \"in progress\") OR issue in (TEST-1, TEST-2) ORDER BY created"
}

Received an empty Json response using Python Requests

On zhihu, a Chinese Q&A community similar to Quora,I am writing a small program to create a list of users who follow a particular user. On the page showing this information, by scrolling down to the bottom, the browser sends a post request and receives a response in json to extend the followers list.
A snippet of the received json is (copied from firebug):
{"r":0,"msg":["<div class=\"zm-profile-card zm-profile-section-item zg-clear no-hovercard\">\n<div class=\"zg-right\">\n<button data-follow=\"m:button\" data-id=\"f09ebe71535bd89a43dd979c77cf3676\" class=\"zg-btn zg-btn-unfollow zm-rich-follow-btn small nth-0\">\u53d6\u6d88\u5173\u6ce8<\/button>.....
I have little knowledge about json but I am sure that 'msg' contains information about followers.
In my program, I use Python Requests module to send this post request to server.
payload={"method":"next","params":params,"_xsrf":_xsrf}#form data
response=session.post('http://www.zhihu.com/node/ProfileFollowersListV2',data=payload,headers=header)
response has a status code 200, but response.json() returns:
{u'msg': [], u'r': 0}
where the 'msg' is empty. Can anyone help me with this?
I encountered this very problem when I tried to get the content in the returned json file. To solve this, you just need to adjust one thing.
payload={"method":"next","params":params,"_xsrf":_xsrf}
Notice the params. You didn't show us what exactly it was. Since you and I have the same question, I'd assume that your params looks like this,
params = json.dumps({"offset":20,"order_by":"created","hash_id":"blablabla"})
Here is the big one. Your value of "offset" must be an integer, 20 in this case, but definitely not a string, say something like "20". It's really hard to tell what goes wrong when every element is double quoted.
Remember,the value of "offset" must be an integer!
"offset":20