Questions tagged [json-query]

Use this tag for tasks involving queries against a JSON document, such as extracting JSON components from a JSON text. The tag can also be used for query languages intended for specifying such queries.

254 questions
0
votes
1 answer

Azure SQL: get all values of JSON of a column

I have simplified my problem for the sake of this question, I am trying to get all the ReferenceId and Options values of the JSON using SQL but I am getting NULL. Can someone help me with this? DECLARE @jsonInfo VARCHAR(MAX) SET…
OTUser
  • 3,788
  • 19
  • 69
  • 127
0
votes
2 answers

Getting template error while templating string when trying to work with json and json_query filter

I try to execute this ansible command : ansible localhost -m debug -a "var={{ db_config| to_json |json_query(*)}}" \ -e 'db_config=[{"name":"mydb1","services":["app1","app2"]},{"name":"mydb12","services":["app1"]}]' To get all json elements…
user63898
  • 29,839
  • 85
  • 272
  • 514
0
votes
1 answer

escape forward slash in jsonpath

I'm trying to write a simple JSON path query oc get pa -o jsonpath='{range.data[*]}{@.data.vpa.pa\.poc\.hpa\\/value}{"\n"}{end}' "data" [ { "vpa" { "pa.poc.hpa/value" : 20 } } ] from above JSON trying to get 20 …
kiran k
  • 41
  • 8
0
votes
1 answer

Ansible - issue with loop and json_query's

Question I need to get the ID from the GET because it's needed in the URL in the PUT task to edit a specific "input" entry. I'm using the Ansible URI to talk to a REST API to manage this. playbook *host_vars/host.yml * --- inputs: - title:…
balpoint
  • 17
  • 4
0
votes
2 answers

How to pass jinja2 variable to json_query

I have the following jinja2 template [ {% for items in hosts %} { "name":"{{ items.name }}", "display_name":"{{ items.display_name }}", "services": {{ host_group | from_json | json_query('[*].services[0]') | to_json }}, } {% endfor…
Karim Sad
  • 9
  • 1
  • 6
0
votes
1 answer

ansible json-query trying to select "id" by content file wildcard

Very new to JSON. I'm trying to extract 2 variables from this json file. It has many files and id's but I only want the file & id if it contains es7.x86_64 When done my desired variables would be: id=13140 file=NessusAgent-8.3.0-es7.x86_64.rpm { …
0
votes
2 answers

How to convert array to String using JSON Query

{ "pull_request": { "patch_url": null, }, "created_at": "2012-11-14T15:25:33Z", "comments": 0, "labels": [ { "color": "ededed } ], "id": 8356941, "assignees": [ { "login": "Paul", …
0
votes
0 answers

Pull data from JSON column and create new output with ABSENT ON NULL option

I have a JSON column in an Oracle DB where it was populated without the ABSENT ON NULL option and there are some pretty long lengths because of this. I would like to trim things down and have created a new table similar to the first but I would like…
programmerNOOB
  • 121
  • 3
  • 19
0
votes
1 answer

I am trying to get the cpucapacity/cpuused value from the below json output from Ansible module am getting blank msg or error

clusters{ "DC0_C0":{ "datacenter":"DC0", "moid":"domain-c9", "drs_default_vm_behavior":"None", "drs_enable_vm_behavior_overrides":"None", "drs_vmotion_rate":"None", "enable_ha":"None", "enabled_drs":true, "enabled_vsan":false, "ha_admission_control_e…
0
votes
1 answer

SQL find elements is in JSON array column

Hello i have a column table who contains json array with tags in it, I try to find a way to select result who contain some of values in it : ID tags 1 ["test01"] 2 ["test02","test03"] I try to used JSON_QUERY AND JSON_VALUE(): SELECT…
morpheus0010
  • 121
  • 2
  • 7
0
votes
1 answer

How can I query JSON of an XML parsing in a client only app?

Sorry for the inappropriate question. But what do you recommend me to use to structure a library that can put a query arrangement on json formats generated by an XML parsing based on TEI p5? I tried to use GraphQL by converting the interfaces of my…
RootAtKali
  • 185
  • 1
  • 14
0
votes
1 answer

How to update JSON query / data after new user input?

I'm creating a weather dashboard that updates every 5 seconds. I would like the user to be able to change the target city, and have the dashboard update with the new data. Problem is every time they input a new city, the previous data stays and it…
ergoProxy
  • 93
  • 9
0
votes
1 answer

Ansible / jmespath - 1d list to zipped list of dictionaries

I'm attempting to transform a 1d list of AWS EC2 IDs into a list of dictionaries suitable for usage as the targets param to the Ansible elb_target_group module. Sample input: TASK [debug] ok: [localhost] => { "instance_ids": [ "i-1111", …
Brad Solomon
  • 38,521
  • 31
  • 149
  • 235
0
votes
2 answers

Ansible json_query to filter list of dict with different key

Here is the list of dict with different keys. my_class: - teacher: first_name: 'Jay' last_name: 'Matt' - teacher: first_name: 'Rick' last_name: 'Cati' - student: first_name: 'Jay' last_name: 'Dito' So to…
Wibe Goose
  • 127
  • 7
0
votes
0 answers

ansible - Query data with json_query

Hello Developer Community! I'm currently working on developing some Ansible playbooks to manage Citrix NetScaler configuration and would like to get some help about the following. I have the following data structure defined in a variable named…
Belabacsi
  • 121
  • 2
  • 10