The task includes an option with an undefined variable. The error was: 'None' has no attribute fallback_ips.yml' - kubespray

I had a problem when installing a kubernetes cluster of 3 masters and 6 workers and 1 ingress, I did not find that someone would have a similar problem. "TASK [kubespray-defaults : create fallback_ips_base] *****
fatal: [k8s-worker1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'None' has no attribute 'get'\n\nThe error appears to be in '/kubespray/roles/kubespray-defaults/tasks/fallback_ips.yml': line 15, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: create fallback_ips_base\n ^ here\n"}"
Command output printf "$(uname -srm)\n$(cat /etc/os-release)\n"
Linux 3.10.0-1160.62.1.el7.x86_64 x86_64
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
ansible --version
ansible 2.10.11
config file = /kubespray/ansible.cfg
configured module search path = ['/kubespray/library']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
Version of Python (python --version):
Python 2.7.5
Network plugin used:
flannel
nodes:
k8s-master1 ansible_host=172.16.18.141 ip=172.16.18.141
k8s-master2 ansible_host=172.16.18.133 ip=172.16.18.133
k8s-master3 ansible_host=172.16.18.134 ip=172.16.18.134
k8s-worker1 ansible_host=172.16.18.135 ip=172.16.18.135
k8s-worker2 ansible_host=172.16.18.136 ip=172.16.18.136
k8s-worker3 ansible_host=172.16.18.137 ip=172.16.18.137
k8s-worker4 ansible_host=172.16.18.138 ip=172.16.18.138
k8s-worker5 ansible_host=172.16.18.140 ip=172.16.18.140
k8s-worker6 ansible_host=172.16.18.139 ip=172.16.18.139
k8s-ingress ansible_host=172.16.18.142 ip=172.16.18.142
[kube_control_plane]
k8s-master1
k8s-master2
k8s-master3
[etcd]
k8s-master2
k8s-master3
k8s-master1
[kube_node]
k8s-worker1
k8s-worker2
k8s-worker3
k8s-worker4
k8s-worker5
k8s-worker6
k8s-ingress
[kube_ingress]
k8s-ingress
[k8s_cluster:children]
kube_node
kube_control_plane
ansible -m setup:
k8s-worker1 | SUCCESS => {
"ansible_facts": {
"ansible_apparmor": {
"status": "disabled"
},
"ansible_architecture": "x86_64",
"ansible_bios_date": "09/17/2015",
"ansible_bios_vendor": "Phoenix Technologies LTD",
"ansible_bios_version": "6.00",
"ansible_board_asset_tag": "NA",
"ansible_board_name": "440BX Desktop Reference Platform",
"ansible_board_serial": "None",
"ansible_board_vendor": "Intel Corporation",
"ansible_board_version": "None",
"ansible_chassis_asset_tag": "No Asset Tag",
"ansible_chassis_serial": "None",
"ansible_chassis_vendor": "No Enclosure",
"ansible_chassis_version": "N/A",
"ansible_cmdline": {
"BOOT_IMAGE": "/vmlinuz-3.10.0-1160.62.1.el7.x86_64",
"LANG": "en_US.UTF-8",
"crashkernel": "auto",
"quiet": true,
"rd.lvm.lv": "centos/swap",
"rhgb": true,
"ro": true,
"root": "/dev/mapper/centos-root"
},
"ansible_date_time": {
"date": "2022-06-02",
"day": "02",
"epoch": "1654127793",
"hour": "02",
"iso8601": "2022-06-01T23:56:33Z",
"iso8601_basic": "20220602T025633575892",
"iso8601_basic_short": "20220602T025633",
"iso8601_micro": "2022-06-01T23:56:33.575892Z",
"minute": "56",
"month": "06",
"second": "33",
"time": "02:56:33",
"tz": "IDT",
"tz_offset": "+0300",
"weekday": "Thursday",
"weekday_number": "4",
"weeknumber": "22",
"year": "2022"
},
"ansible_device_links": {
"ids": {
"dm-0": [
"dm-name-centos-root",
"dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsro1ok8rizmZLLezdQlepE8PQGLJUrOxrb"
],
"dm-1": [
"dm-name-centos-swap",
"dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsrRm5FHwbU4faE1weTgRbY2xdwQJs5YPpJ"
],
"dm-2": [
"dm-name-centos-home",
"dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsr0wXP3uZEc9Ld1tvj3Cx9dKlN4MhfsbBF"
],
"sda2": [
"lvm-pv-uuid-J3cGFq-UpST-uNKu-8iTN-iWep-Kpxo-Sokz40"
],
"sr0": [
"ata-VMware_Virtual_SATA_CDRW_Drive_00000000000000000001"
]
},
"labels": {},
"masters": {
"sda2": [
"dm-0",
"dm-1",
"dm-2"
]
},
"uuids": {
"dm-0": [
"cdd909fe-d39a-4ea9-8959-fe1aca72a2e8"
],
"dm-1": [
"52b08951-ea16-4abe-8315-35a4261eaef7"
],
"dm-2": [
"18ecd858-0042-4e4d-8c9d-f15236a1c9c7"
],
"sda1": [
"11285025-905b-4798-8560-d1d8900fc90c"
]
}
},
"ansible_devices": {
"dm-0": {
"holders": [],
"host": "",
"links": {
"ids": [
"dm-name-centos-root",
"dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsro1ok8rizmZLLezdQlepE8PQGLJUrOxrb"
],
"labels": [],
"masters": [],
"uuids": [
"cdd909fe-d39a-4ea9-8959-fe1aca72a2e8"
]
},
"model": null,
"partitions": {},
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "104857600",
"sectorsize": "512",
"size": "50.00 GB",
"support_discard": "0",
"vendor": null,
"virtual": 1
},
"dm-1": {
"holders": [],
"host": "",
"links": {
"ids": [
"dm-name-centos-swap",
"dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsrRm5FHwbU4faE1weTgRbY2xdwQJs5YPpJ"
],
"labels": [],
"masters": [],
"uuids": [
"52b08951-ea16-4abe-8315-35a4261eaef7"
]
},
"model": null,
"partitions": {},
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "12320768",
"sectorsize": "512",
"size": "5.88 GB",
"support_discard": "0",
"vendor": null,
"virtual": 1
},
"dm-2": {
"holders": [],
"host": "",
"links": {
"ids": [
"dm-name-centos-home",
"dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsr0wXP3uZEc9Ld1tvj3Cx9dKlN4MhfsbBF"
],
"labels": [],
"masters": [],
"uuids": [
"18ecd858-0042-4e4d-8c9d-f15236a1c9c7"
]
},
"model": null,
"partitions": {},
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "90423296",
"sectorsize": "512",
"size": "43.12 GB",
"support_discard": "0",
"vendor": null,
"virtual": 1
},
"fd0": {
"holders": [],
"host": "",
"links": {
"ids": [],
"labels": [],
"masters": [],
"uuids": []
},
"model": null,
"partitions": {},
"removable": "1",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "deadline",
"sectors": "8",
"sectorsize": "512",
"size": "4.00 KB",
"support_discard": "0",
"vendor": null,
"virtual": 1
},
"sda": {
"holders": [],
"host": "",
"links": {
"ids": [],
"labels": [],
"masters": [],
"uuids": []
},
"model": "Virtual disk",
"partitions": {
"sda1": {
"holders": [],
"links": {
"ids": [],
"labels": [],
"masters": [],
"uuids": [
"11285025-905b-4798-8560-d1d8900fc90c"
]
},
"sectors": "2097152",
"sectorsize": 512,
"size": "1.00 GB",
"start": "2048",
"uuid": "11285025-905b-4798-8560-d1d8900fc90c"
},
"sda2": {
"holders": [
"centos-root",
"centos-swap",
"centos-home"
],
"links": {
"ids": [
"lvm-pv-uuid-J3cGFq-UpST-uNKu-8iTN-iWep-Kpxo-Sokz40"
],
"labels": [],
"masters": [
"dm-0",
"dm-1",
"dm-2"
],
"uuids": []
},
"sectors": "207616000",
"sectorsize": 512,
"size": "99.00 GB",
"start": "2099200",
"uuid": null
}
},
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "deadline",
"sectors": "209715200",
"sectorsize": "512",
"size": "100.00 GB",
"support_discard": "0",
"vendor": "VMware",
"virtual": 1
},
"sr0": {
"holders": [],
"host": "",
"links": {
"ids": [
"ata-VMware_Virtual_SATA_CDRW_Drive_00000000000000000001"
],
"labels": [],
"masters": [],
"uuids": []
},
"model": "VMware SATA CD00",
"partitions": {},
"removable": "1",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "deadline",
"sectors": "2097151",
"sectorsize": "512",
"size": "1024.00 MB",
"support_discard": "0",
"vendor": "NECVMWar",
"virtual": 1
}
},
"ansible_distribution": "CentOS",
"ansible_distribution_file_parsed": true,
"ansible_distribution_file_path": "/etc/redhat-release",
"ansible_distribution_file_variety": "RedHat",
"ansible_distribution_major_version": "7",
"ansible_distribution_release": "Core",
"ansible_distribution_version": "7.9",
"ansible_dns": {
"nameservers": [
"172.16.1.1"
]
},
"ansible_domain": "s000.local",
"ansible_effective_group_id": 0,
"ansible_effective_user_id": 0,
"ansible_env": {
"HOME": "/root",
"LANG": "C",
"LC_ALL": "C",
"LC_NUMERIC": "C",
"LESSOPEN": "||/usr/bin/lesspipe.sh %s",
"LOGNAME": "root",
"MAIL": "/var/mail/root",
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin",
"PWD": "/root",
"SELINUX_LEVEL_REQUESTED": "",
"SELINUX_ROLE_REQUESTED": "",
"SELINUX_USE_CURRENT_RANGE": "",
"SHELL": "/bin/bash",
"SHLVL": "2",
"SSH_CLIENT": "172.16.18.131 42184 22",
"SSH_CONNECTION": "172.16.18.131 42184 172.16.18.135 22",
"USER": "root",
"XDG_RUNTIME_DIR": "/run/user/0",
"XDG_SESSION_ID": "19",
"_": "/usr/bin/python"
},
"ansible_fibre_channel_wwn": [],
"ansible_fips": false,
"ansible_form_factor": "Other",
"ansible_fqdn": "k8s-worker1.s000.local",
"ansible_hostname": "k8s-worker1",
"ansible_hostnqn": "",
"ansible_is_chroot": false,
"ansible_iscsi_iqn": "",
"ansible_kernel": "3.10.0-1160.62.1.el7.x86_64",
"ansible_kernel_version": "#1 SMP Tue Apr 5 16:57:59 UTC 2022",
"ansible_local": {},
"ansible_lsb": {},
"ansible_lvm": {
"lvs": {
"home": {
"size_g": "43.12",
"vg": "centos"
},
"root": {
"size_g": "50.00",
"vg": "centos"
},
"swap": {
"size_g": "5.88",
"vg": "centos"
}
},
"pvs": {
"/dev/sda2": {
"free_g": "0.00",
"size_g": "99.00",
"vg": "centos"
}
},
"vgs": {
"centos": {
"free_g": "0.00",
"num_lvs": "3",
"num_pvs": "1",
"size_g": "99.00"
}
}
},
"ansible_machine": "x86_64",
"ansible_machine_id": "32496b187f444d3b95eeafeb0fce0cae",
"ansible_memfree_mb": 5297,
"ansible_memory_mb": {
"nocache": {
"free": 5508,
"used": 297
},
"real": {
"free": 5297,
"total": 5805,
"used": 508
},
"swap": {
"cached": 0,
"free": 0,
"total": 0,
"used": 0
}
},
"ansible_memtotal_mb": 5805,
"ansible_mounts": [
{
"block_available": 210041,
"block_size": 4096,
"block_total": 259584,
"block_used": 49543,
"device": "/dev/sda1",
"fstype": "xfs",
"inode_available": 523954,
"inode_total": 524288,
"inode_used": 334,
"mount": "/boot",
"options": "rw,seclabel,relatime,attr2,inode64,noquota",
"size_available": 860327936,
"size_total": 1063256064,
"uuid": "11285025-905b-4798-8560-d1d8900fc90c"
},
{
"block_available": 12278107,
"block_size": 4096,
"block_total": 13100800,
"block_used": 822693,
"device": "/dev/mapper/centos-root",
"fstype": "xfs",
"inode_available": 26161376,
"inode_total": 26214400,
"inode_used": 53024,
"mount": "/",
"options": "rw,seclabel,relatime,attr2,inode64,noquota",
"size_available": 50291126272,
"size_total": 53660876800,
"uuid": "cdd909fe-d39a-4ea9-8959-fe1aca72a2e8"
},
{
"block_available": 11289145,
"block_size": 4096,
"block_total": 11297393,
"block_used": 8248,
"device": "/dev/mapper/centos-home",
"fstype": "xfs",
"inode_available": 22605821,
"inode_total": 22605824,
"inode_used": 3,
"mount": "/home",
"options": "rw,seclabel,relatime,attr2,inode64,noquota",
"size_available": 46240337920,
"size_total": 46274121728,
"uuid": "18ecd858-0042-4e4d-8c9d-f15236a1c9c7"
}
],
"ansible_nodename": "k8s-worker1",
"ansible_os_family": "RedHat",
"ansible_pkg_mgr": "yum",
"ansible_proc_cmdline": {
"BOOT_IMAGE": "/vmlinuz-3.10.0-1160.62.1.el7.x86_64",
"LANG": "en_US.UTF-8",
"crashkernel": "auto",
"quiet": true,
"rd.lvm.lv": [
"centos/root",
"centos/swap"
],
"rhgb": true,
"ro": true,
"root": "/dev/mapper/centos-root"
},
"ansible_processor": [
"0",
"GenuineIntel",
"Intel(R) Xeon(R) CPU E5-2650 v2 # 2.60GHz",
"1",
"GenuineIntel",
"Intel(R) Xeon(R) CPU E5-2650 v2 # 2.60GHz",
"2",
"GenuineIntel",
"Intel(R) Xeon(R) CPU E5-2650 v2 # 2.60GHz",
"3",
"GenuineIntel",
"Intel(R) Xeon(R) CPU E5-2650 v2 # 2.60GHz"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 4,
"ansible_processor_nproc": 4,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 4,
"ansible_product_name": "VMware Virtual Platform",
"ansible_product_serial": "VMware-56 4d f7 52 8a 2f 19 11-ea 9d 2f c8 ed 50 ef 3e",
"ansible_product_uuid": "564DF752-8A2F-1911-EA9D-2FC8ED50EF3E",
"ansible_product_version": "None",
"ansible_python": {
"executable": "/usr/bin/python",
"has_sslcontext": true,
"type": "CPython",
"version": {
"major": 2,
"micro": 5,
"minor": 7,
"releaselevel": "final",
"serial": 0
},
"version_info": [
2,
7,
5,
"final",
0
]
},
"ansible_python_version": "2.7.5",
"ansible_real_group_id": 0,
"ansible_real_user_id": 0,
"ansible_selinux": {
"config_mode": "permissive",
"mode": "permissive",
"policyvers": 31,
"status": "enabled",
"type": "targeted"
},
"ansible_selinux_python_present": true,
"ansible_service_mgr": "systemd",
"ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHqsSpmuUFd15ttkWjkpvPgflGaP1ESchUZA8MI0CTviJIHUCz2h3mH1PMTMZwqnaAkdOp1sJQjT09omvBBets0=",
"ansible_ssh_host_key_ecdsa_public_keytype": "ecdsa-sha2-nistp256",
"ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIEaCutePk/HnsQX6kFpBZxPqCIfF8i7kYnj5xRQjBI6A",
"ansible_ssh_host_key_ed25519_public_keytype": "ssh-ed25519",
"ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDAzM6HtHaQKXZEZ127SSzfLkr4WEz2EGWdTRKZJCQWsxwJmMckWOP7gaC5jHEQ50pu03BH0JrSq9sH4mBuxkB7tudsEMruoSYmfODvrJ39aQDTtDCbrtCvXWLcFmtwfpawrN2FrsqMz7wrvcfSR/t8Nmx3eRtuSXhFTj30mQJ9bEUQHuL3+BGrjaJArzFVWvbkvuPFn1nvAYdoXwSGrBIFq6vVNyA+1IIt3bZH1ZRMwPxCqQ2xxZA8nRnxGSpaZaNN9DiM+64Z1goTzFAXZXRDpx2YqyDF7vImNRpuJFNTCHpCHTbFWVjBre51HAgJoTLen+LafiF52elaGTgS+H6l",
"ansible_ssh_host_key_rsa_public_keytype": "ssh-rsa",
"ansible_swapfree_mb": 0,
"ansible_swaptotal_mb": 0,
"ansible_system": "Linux",
"ansible_system_capabilities": [
"cap_chown",
"cap_dac_override",
"cap_dac_read_search",
"cap_fowner",
"cap_fsetid",
"cap_kill",
"cap_setgid",
"cap_setuid",
"cap_setpcap",
"cap_linux_immutable",
"cap_net_bind_service",
"cap_net_broadcast",
"cap_net_admin",
"cap_net_raw",
"cap_ipc_lock",
"cap_ipc_owner",
"cap_sys_module",
"cap_sys_rawio",
"cap_sys_chroot",
"cap_sys_ptrace",
"cap_sys_pacct",
"cap_sys_admin",
"cap_sys_boot",
"cap_sys_nice",
"cap_sys_resource",
"cap_sys_time",
"cap_sys_tty_config",
"cap_mknod",
"cap_lease",
"cap_audit_write",
"cap_audit_control",
"cap_setfcap",
"cap_mac_override",
"cap_mac_admin",
"cap_syslog",
"35",
"36+ep"
],
"ansible_system_capabilities_enforced": "True",
"ansible_system_vendor": "VMware, Inc.",
"ansible_uptime_seconds": 56108,
"ansible_user_dir": "/root",
"ansible_user_gecos": "root",
"ansible_user_gid": 0,
"ansible_user_id": "root",
"ansible_user_shell": "/bin/bash",
"ansible_user_uid": 0,
"ansible_userspace_architecture": "x86_64",
"ansible_userspace_bits": "64",
"ansible_virtualization_role": "guest",
"ansible_virtualization_type": "VMware",
"gather_subset": [
"all"
],
"module_setup": true
},
"changed": false
}

Related

How can I read array data in table format using Talend ETL?

Hello,
I'm new in Talend. Want to extract data from file to table format.
What will steps to retrieve data in column format from below data -( _id,projectName,title,value)
Array data -
[
{
"_id": 1,
"projectName": "Test",
"languageId": 1,
"userId": 100,
"userDetails": {
"location": {
"coordinates": [
19.2666415,
72.9814762
]
},
"serialNumber": "5ab24f2d2ce1"
},
"questionDetails": [
{
"_id": 1,
"title": "QuestionName 01",
"description": "QuestionName 01",
"question": "QuestionName 01",
"type": "Radio",
"optionMap": {
"1": "Option 01",
"2": "Option 01"
},
"response": {
"value": [
"2"
]
},
"responseExtension": {
"comments": "",
"reviews": "",
"summary": "",
"imageURLs": [
],
"videoURLs": [
],
"audioURLs": [
]
}
}
],
"createdDate": {
"$date": {
"$numberLong": "1603802807000"
}
},
"lastModifiedDate": {
"$date": {
"$numberLong": "1603802807000"
}
},
"_class": "dummy"
},
{
"_id": 2,
"projectName": "Test",
"languageId": 1,
"userId": 101,
"surveyId": 1,
"sectionId": 10,
"userDetails": {
"location": {
"coordinates": [
19.0564471,
72.9033019
]
},
"serialNumber": "d8ee581588c2"
},
"questionDetails": [
{
"_id": 11,
"title": "QuestionName 02",
"description": "QuestionName 02",
"question": "QuestionName 02",
"type": "Radio",
"optionMap": {
"1": "Option 02",
"2": "Option 02"
},
"response": {
"value": [
"1"
]
},
"responseExtension": {
"comments": "",
"reviews": "",
"summary": "",
"imageURLs": [
],
"videoURLs": [
],
"audioURLs": [
]
}
}
],
"isActive": false,
"communication": {
},
"questionIndex": 0,
"isAboutToFinish": false,
"managingStatus": "archived",
"sectionIds": [
],
"questionResponses": [
],
"createdDate": {
"$date": {
"$numberLong": "1603372059000"
}
},
"lastModifiedDate": {
"$date": {
"$numberLong": "1658313691000"
}
},
"_class": "dummy"
}
]

Extract value from response and use it in next sampler request body specific

How to extract an id like 5105800, 5105801, 5105802 and his quantity 200, 50 , 40 from response Body and reuse it in the request body as show below?
Response Body:
{
"data": {
"callOrders": [
{
"promotionId": null,
"Promotion": null,
"Lines": [
{
"id": 5105800,
"quantity": 200,
"skuId": 85,
"callId": 494281,
"skuBatchId": 587,
"amountDetails": {
"rate": 144.22,
"grossAmount": 32593.72,
"netAmount": 32593.72,
"taxAmount": 3749.72,
"taxableAmount": 28844,
"subTotal": 28844,
"billDiscount": 0,
"tradeDiscount": 0,
"discountAmount": 0,
"promotionDiscount": 0,
"topUpDiscount": 0,
"__typename": "AmountDetail"
},
"rateDetails": {
"rlp": 144.22,
"rlpWithVat": 162.9686,
"netPrice": 144.22,
"netPriceWithVat": 162.9686,
"__typename": "RateDetail"
},
"SKU": {
"id": 85,
"title": "Ariel Oxyblu 500 gm x 48 [82262305]",
"__typename": "SKU"
},
"SKUBatch": {
"priceDetails": {
"rlp": 144.22,
"dlp": 137.35,
"vatPercentage": 0.13,
"mrpSrp": 176,
"mrpStatus": true,
"__typename": "SKUPrice"
},
"batchDetails": {
"batchNumber": "DEFAULT_BATCH",
"__typename": "SKUBatch"
},
"usageDate": {
"manufacture": "0000-00-00",
"expiry": "0000-00-00",
"__typename": "SKUUsage"
},
"updatedAt": "2018-12-01",
"active": true,
"__typename": "SKUBatchRate"
},
"Promotion": {
"id": null,
"title": null,
"type": null,
"scope": null,
"criteria": null,
"__typename": "Promotion"
},
"promotionId": null,
"distributorId": 16,
"__typename": "Line",
"inStock": "INSTOCK",
"freeSku": false,
"focusedSku": true
},
{
"id": 5105801,
"quantity": 50,
"skuId": 82,
"callId": 494281,
"skuBatchId": 551,
"amountDetails": {
"rate": 281.88,
"grossAmount": 15926.22,
"netAmount": 15926.22,
"taxAmount": 1832.22,
"taxableAmount": 14094,
"subTotal": 14094,
"billDiscount": 0,
"tradeDiscount": 0,
"discountAmount": 0,
"promotionDiscount": 0,
"topUpDiscount": 0,
"__typename": "AmountDetail"
},
"rateDetails": {
"rlp": 281.88,
"rlpWithVat": 318.5244,
"netPrice": 281.88,
"netPriceWithVat": 318.5244,
"__typename": "RateDetail"
},
"SKU": {
"id": 82,
"title": "Ariel Oxyblu 1 kg x 24 [82250306]",
"__typename": "SKU"
},
"SKUBatch": {
"priceDetails": {
"rlp": 281.88,
"dlp": 268.45,
"vatPercentage": 0.13,
"mrpSrp": 344,
"mrpStatus": true,
"__typename": "SKUPrice"
},
"batchDetails": {
"batchNumber": "DEFAULT_BATCH",
"__typename": "SKUBatch"
},
"usageDate": {
"manufacture": "0000-00-00",
"expiry": "0000-00-00",
"__typename": "SKUUsage"
},
"updatedAt": "2018-01-31",
"active": true,
"__typename": "SKUBatchRate"
},
"Promotion": {
"id": null,
"title": null,
"type": null,
"scope": null,
"criteria": null,
"__typename": "Promotion"
},
"promotionId": null,
"distributorId": 16,
"__typename": "Line",
"inStock": "INSTOCK",
"freeSku": false,
"focusedSku": true
},
{
"id": 5105802,
"quantity": 40,
"skuId": 769,
"callId": 494281,
"skuBatchId": 733,
"amountDetails": {
"rate": 197.53,
"grossAmount": 8928.356,
"netAmount": 8928.356,
"taxAmount": 1027.156,
"taxableAmount": 7901.2,
"subTotal": 7901.2,
"billDiscount": 0,
"tradeDiscount": 0,
"discountAmount": 0,
"promotionDiscount": 0,
"topUpDiscount": 0,
"__typename": "AmountDetail"
},
"rateDetails": {
"rlp": 197.53,
"rlpWithVat": 223.2089,
"netPrice": 197.53,
"netPriceWithVat": 223.2089,
"__typename": "RateDetail"
},
"SKU": {
"id": 769,
"title": "H&S 2in1 Active Protect 180 ml x 24 [82302894]",
"__typename": "SKU"
},
"SKUBatch": {
"priceDetails": {
"rlp": 197.53,
"dlp": 186.35,
"vatPercentage": 0.13,
"mrpSrp": 250,
"mrpStatus": true,
"__typename": "SKUPrice"
},
"batchDetails": {
"batchNumber": "DEFAULT_BATCH",
"__typename": "SKUBatch"
},
"usageDate": {
"manufacture": "0000-00-00",
"expiry": "0000-00-00",
"__typename": "SKUUsage"
},
"updatedAt": "2019-11-05",
"active": true,
"__typename": "SKUBatchRate"
},
"Promotion": {
"id": null,
"title": null,
"type": null,
"scope": null,
"criteria": null,
"__typename": "Promotion"
},
"promotionId": null,
"distributorId": 16,
"__typename": "Line",
"inStock": "INSTOCK",
"freeSku": false,
"focusedSku": false
}
],
"__typename": "PromotionOrder"
}
]
}
}
Request Body:
{
"operationName": null,
"variables": {
"input": {
"invoiceId": 3683663,
"orderDetails": [
{
"id": 5105800,
"quantity": 200
},
{
"id": 5105801,
"quantity": 50
},
{
"id": 5105802,
"quantity": 40
}
]
},
"type": "CatalogDetail"
},
"query": "mutation ($input: DispatchInput!) {\n dispatchInvoice(input: $input) {\n id\n __typename\n }\n}\n"
}
When you use JavaScript, you could use the following one :)
const responseBody = {
"data": {
"callOrders": [
{
"promotionId": null,
"Promotion": null,
"Lines": [
{
"id": 5105800,
"quantity": 200,
"skuId": 85,
"callId": 494281,
"skuBatchId": 587,
"amountDetails": {
"rate": 144.22,
"grossAmount": 32593.72,
"netAmount": 32593.72,
"taxAmount": 3749.72,
"taxableAmount": 28844,
"subTotal": 28844,
"billDiscount": 0,
"tradeDiscount": 0,
"discountAmount": 0,
"promotionDiscount": 0,
"topUpDiscount": 0,
"__typename": "AmountDetail"
},
"rateDetails": {
"rlp": 144.22,
"rlpWithVat": 162.9686,
"netPrice": 144.22,
"netPriceWithVat": 162.9686,
"__typename": "RateDetail"
},
"SKU": {
"id": 85,
"title": "Ariel Oxyblu 500 gm x 48 [82262305]",
"__typename": "SKU"
},
"SKUBatch": {
"priceDetails": {
"rlp": 144.22,
"dlp": 137.35,
"vatPercentage": 0.13,
"mrpSrp": 176,
"mrpStatus": true,
"__typename": "SKUPrice"
},
"batchDetails": {
"batchNumber": "DEFAULT_BATCH",
"__typename": "SKUBatch"
},
"usageDate": {
"manufacture": "0000-00-00",
"expiry": "0000-00-00",
"__typename": "SKUUsage"
},
"updatedAt": "2018-12-01",
"active": true,
"__typename": "SKUBatchRate"
},
"Promotion": {
"id": null,
"title": null,
"type": null,
"scope": null,
"criteria": null,
"__typename": "Promotion"
},
"promotionId": null,
"distributorId": 16,
"__typename": "Line",
"inStock": "INSTOCK",
"freeSku": false,
"focusedSku": true
},
{
"id": 5105801,
"quantity": 50,
"skuId": 82,
"callId": 494281,
"skuBatchId": 551,
"amountDetails": {
"rate": 281.88,
"grossAmount": 15926.22,
"netAmount": 15926.22,
"taxAmount": 1832.22,
"taxableAmount": 14094,
"subTotal": 14094,
"billDiscount": 0,
"tradeDiscount": 0,
"discountAmount": 0,
"promotionDiscount": 0,
"topUpDiscount": 0,
"__typename": "AmountDetail"
},
"rateDetails": {
"rlp": 281.88,
"rlpWithVat": 318.5244,
"netPrice": 281.88,
"netPriceWithVat": 318.5244,
"__typename": "RateDetail"
},
"SKU": {
"id": 82,
"title": "Ariel Oxyblu 1 kg x 24 [82250306]",
"__typename": "SKU"
},
"SKUBatch": {
"priceDetails": {
"rlp": 281.88,
"dlp": 268.45,
"vatPercentage": 0.13,
"mrpSrp": 344,
"mrpStatus": true,
"__typename": "SKUPrice"
},
"batchDetails": {
"batchNumber": "DEFAULT_BATCH",
"__typename": "SKUBatch"
},
"usageDate": {
"manufacture": "0000-00-00",
"expiry": "0000-00-00",
"__typename": "SKUUsage"
},
"updatedAt": "2018-01-31",
"active": true,
"__typename": "SKUBatchRate"
},
"Promotion": {
"id": null,
"title": null,
"type": null,
"scope": null,
"criteria": null,
"__typename": "Promotion"
},
"promotionId": null,
"distributorId": 16,
"__typename": "Line",
"inStock": "INSTOCK",
"freeSku": false,
"focusedSku": true
},
{
"id": 5105802,
"quantity": 40,
"skuId": 769,
"callId": 494281,
"skuBatchId": 733,
"amountDetails": {
"rate": 197.53,
"grossAmount": 8928.356,
"netAmount": 8928.356,
"taxAmount": 1027.156,
"taxableAmount": 7901.2,
"subTotal": 7901.2,
"billDiscount": 0,
"tradeDiscount": 0,
"discountAmount": 0,
"promotionDiscount": 0,
"topUpDiscount": 0,
"__typename": "AmountDetail"
},
"rateDetails": {
"rlp": 197.53,
"rlpWithVat": 223.2089,
"netPrice": 197.53,
"netPriceWithVat": 223.2089,
"__typename": "RateDetail"
},
"SKU": {
"id": 769,
"title": "H&S 2in1 Active Protect 180 ml x 24 [82302894]",
"__typename": "SKU"
},
"SKUBatch": {
"priceDetails": {
"rlp": 197.53,
"dlp": 186.35,
"vatPercentage": 0.13,
"mrpSrp": 250,
"mrpStatus": true,
"__typename": "SKUPrice"
},
"batchDetails": {
"batchNumber": "DEFAULT_BATCH",
"__typename": "SKUBatch"
},
"usageDate": {
"manufacture": "0000-00-00",
"expiry": "0000-00-00",
"__typename": "SKUUsage"
},
"updatedAt": "2019-11-05",
"active": true,
"__typename": "SKUBatchRate"
},
"Promotion": {
"id": null,
"title": null,
"type": null,
"scope": null,
"criteria": null,
"__typename": "Promotion"
},
"promotionId": null,
"distributorId": 16,
"__typename": "Line",
"inStock": "INSTOCK",
"freeSku": false,
"focusedSku": false
}
],
"__typename": "PromotionOrder"
}
]
}
};
const orderDetails = [];
responseBody.data.callOrders.forEach((entry) => {
entry.Lines.forEach(({ id, quantity }) => {
orderDetails.push({ id, quantity });
})
});
const requestBody = {
"operationName": null,
"variables": {
"input": {
"invoiceId": 3683663,
"orderDetails": orderDetails
},
"type": "CatalogDetail"
},
"query": "mutation ($input: DispatchInput!) {\n dispatchInvoice(input: $input) {\n id\n __typename\n }\n}\n"
};
console.log(requestBody);

Can someone help me create a test in Postman in order to validate that a key has the expected value inside a nested group?

Can someone point me in the right direction to write a test in Postman in order to validate that a certain key or value from the following response is present. The response has a lot of nested objects.
Specifically I want to validate the following:
I want to validate that in the output.treatments there's a key "type" with the value "Diet" present
and I also want to validate that in the output.treatments.details there's a key "name" with the value "SULFAMETHOXAZOLE/TRIMETHOPRIM"
Thanks!
The API response looks like this:
{
"additionalInformation": {
"knownDrugAllergies": [],
"knownDrugConflicts": [
{
"conflict": "OXYBUTYNIN CHLORIDE",
"potentialDrugs": [
"item1",
"item2"
]
}
],
"knownPrecautionConflicts": [
{
"conflict": "OXYBUTYNIN CHLORIDE",
"potentialDrugs": [
"Drowsy",
"Gastroesophageal Reflux",
"Myasthenia Gravis",
"Parkinsonism",
"Ulcerative Colitis"
]
}
]
},
"output": [
{
"icdCode": "N39.3",
"icdDesc": "Stress incontinence (female) (male)",
"isIllness": true,
"treatments": [
{
"details": [],
"type": "Physical Exam"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Normal Diet",
"name": "Normal Diet",
"nameDetails": "The patient has no dietary restrictions",
"priority": 16,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Diet"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "No Restrictions",
"name": "No Restrictions",
"nameDetails": "The patient has no activity restrictions",
"priority": 16,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Activity"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "None Needed ",
"name": "None Needed",
"nameDetails": "No physical therapy is needed.",
"priority": 20,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Physical Therapy"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Kegel Exercises",
"name": "Kegel Exercises",
"nameDetails": "INCOMPLETE",
"priority": 20,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Counseling"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Patient Can Resume Work/School Immediately",
"name": "Immediately",
"nameDetails": "Patient Can Resume Work/School Immediately",
"priority": 8,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Return to Work/School Status"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Wound Care Not Needed",
"name": "Not Needed",
"nameDetails": "Wound Care Not Needed",
"priority": 20,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
],
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Wound Care"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Urine Analysis",
"name": "Urine Analysis",
"nameDetails": "Evaluate the urine for electrolytes and pH.",
"priority": 20,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Labs"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group Placeholder",
"longName": "Specialist Consultation",
"name": "Specialist Consult",
"nameDetails": "The patient should consult with a specialist in the appropriate field.",
"priority": 29,
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
]
]
}
],
"type": "Discharge Disposition"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Group 2",
"longName": "placeholder",
"name": "DULOXETINE HCL",
"nameDetails": "Name Details Placeholder",
"priority": 20,
"protocol": [
"example"
],
"rank": 1,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
]
]
},
{
"directions": [],
"dosage": "",
"groupName": "Standard",
"longName": "placeholder",
"name": "SULFAMETHOXAZOLE/TRIMETHOPRIM",
"nameDetails": "Name Details Placeholder",
"priority": 20,
"protocol": [
"example"
],
"rank": 3,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
]
]
},
{
"directions": [],
"dosage": "",
"groupName": "Standard",
"longName": "placeholder",
"name": "TOLTERODINE TARTRATE",
"nameDetails": "Name Details Placeholder",
"priority": 20,
"protocol": [
"example"
],
"rank": 1,
"reasons": [],
"sources": [
[
"no sources",
"no URL"
]
]
}
],
"type": "Prescription Drugs"
},
{
"details": [
{
"directions": [],
"dosage": "",
"groupName": "Standard",
"longName": "placeholder",
"name": "OXYBUTYNIN",
"nameDetails": "Name Details Placeholder",
"priority": 20,
"protocol": [
"example"
],
"rank": 2,
"reasons": [],
"sources": [
[
"TEST",
"https://google.com"
]
]
}
],
"type": "OTC Drugs"
}
]
}
],
"status": "Complete",
"version": 3
}
Found the solution:
var jsonData = pm.response.json();
pm.test("OXYBUTYNIN present", function () {
pm.expect(_isContains(jsonData.output, "name" ,"OXYBUTYNIN")).to.be.true;
});
pm.test("TOLTERODINE TARTRATE present", function () {
pm.expect(_isContains(jsonData.output, "name" ,"TOLTERODINE TARTRATE")).to.be.true;
});
pm.test("SULFAMETHOXAZOLE/TRIMETHOPRIM present", function () {
pm.expect(_isContains(jsonData.output, "name" ,"SULFAMETHOXAZOLE/TRIMETHOPRIM")).to.be.true;
});
pm.test("DULOXETINE HCL present", function () {
pm.expect(_isContains(jsonData.output, "name" ,"DULOXETINE HCL")).to.be.true;
});
function _isContains(json, keyname, value) {
return Object.keys(json).some(key => {
return typeof json[key] === 'object' ?
_isContains(json[key], keyname, value) : key === keyname && json[key] === value;
});
}

How to filter laravel collection from given data

i have a collection data
{
"success": true,
"doctor": [
{
"id": 1,
"name": "Dr. Mayank",
"dob": "1975-01-01",
"about": "This is description",
"status": 1,
"rating": 2,
"rating_given_by": 1,
"alternative_number": "7686876876",
"profile_photo": [],
"speciality": [
{
"id": 3,
"name": "Acupuncture",
"image": null,
"dashboard_flag": 1
},
{
"id": 4,
"name": "Acupuncturist",
"image": null,
"dashboard_flag": 1
},
{
"id": 1,
"name": "Accident and emergency medicine",
"image": "http://192.168.16.21/remidify/media/174/detail.png",
"dashboard_flag": 1
}
],
"service": [
{
"id": 78,
"name": "Correction of gummy smile",
"cost": "12.00"
},
{
"id": 77,
"name": "Dental aesthetics",
"cost": "43.00"
}
],
"clinics": [
{
"id": 1,
"name": "akram",
"entity_id": 1,
"entity_type": "App\Doctor",
"contact_number": "2132132132132",
"status": 0,
"consultancy_fee": "12.00",
"available_today": "No",
"owner_name": "Dr. Mayank",
"pivot": {
"doctor_id": 1,
"clinic_id": 1
},
"address": {
"id": 1,
"address_1": "asdasdasdsa",
"address_2": "",
"locality": "downtown",
"city": "noida",
"state": "up",
"postal_code": "41561566"
},
"speciality": [],
"service": [
{
"id": 11,
"name": "Laminates",
"cost": "20.00"
},
{
"id": 12,
"name": "Dental surgery",
"cost": "300.00"
}
],
"clinic_image": [
{
"id": 7,
"model_id": 1,
"model_type": "App\Clinic",
"collection_name": "clinic_image",
"file_name": "1494863957588.566162.jpg",
"disk": "media",
"url": "http://192.168.16.21/remidify/media/7/1494863957588.566162.jpg"
}
],
"id_image": [
{
"id": 8,
"model_id": 1,
"model_type": "App\Clinic",
"collection_name": "id_image",
"file_name": "1494863966218.348877.jpg",
"disk": "media",
"url": "http://192.168.16.21/remidify/media/8/1494863966218.348877.jpg"
}
],
"location": {
"id": 1,
"latitude": 0,
"longitude": 0,
"entity_id": 1,
"entity_type": "App\Clinic",
"created_at": "2017-05-16 03:00:10",
"updated_at": "2017-05-16 03:00:10"
},
"clinic_timings": [
{
"day": "sun",
"opens_at": "09:28:00",
"closes_at": "21:28:00"
}
]
}
],
"education": [
{
"id": 19,
"degree": "MBBS",
"university": "Univercity",
"year": "2017",
"entity_id": 1,
"entity_type": "App\Doctor",
"created_at": "2017-05-16 05:44:11",
"updated_at": "2017-05-16 05:44:11",
"location": "Delhi"
}
],
"experience": [
{
"id": 19,
"hospital": "Hospital name",
"post": "pta ni hai",
"from": "1970-01-01",
"to": "0000-00-00",
"entity_id": 1,
"entity_type": "App\Doctor",
"created_at": "2017-05-16 05:44:12",
"updated_at": "2017-05-16 05:44:12",
"location": "Locations12",
"is_currently_working": 1
}
],
"registration": {
"id": 1,
"registration_number": "Reg # 2324324",
"registration_year": 1975,
"registration_council": "Council",
"experience": null,
"doctor_id": 1,
"created_at": "2017-05-16 02:56:37",
"updated_at": "2017-05-16 02:56:37",
"adhaar_number": "232131231232",
"id_proof": [
{
"id": 2,
"model_id": 1,
"model_type": "App\DoctorRegistration",
"collection_name": "id_proof",
"file_name": "1494863680447.329102.jpg",
"disk": "media",
"url": "http://192.168.16.21/remidify/media/2/1494863680447.329102.jpg"
}
],
"registration_proof": [
{
"id": 3,
"model_id": 1,
"model_type": "App\DoctorRegistration",
"collection_name": "registration_proof",
"file_name": "1494863687436.266846.jpg",
"disk": "media",
"url": "http://192.168.16.21/remidify/media/3/1494863687436.266846.jpg"
}
],
"qualification_proof": [
{
"id": 4,
"model_id": 1,
"model_type": "App\DoctorRegistration",
"collection_name": "qualification_proof",
"file_name": "1494863695576.803955.jpg",
"disk": "media",
"url": "http://192.168.16.21/remidify/media/4/1494863695576.803955.jpg"
}
]
},
"preference": {
"availability": 1,
"appointment_confirmation_method": "manual",
"average_time": 7,
"holiday_from": null,
"holiday_till": null,
"patients_per_hour": null,
"preferred_appointment_type": "timeslot",
"appointment_frequency": null,
"preferred_payment_method": [
{
"payment_method": "cash"
},
{
"payment_method": "online"
}
]
},
"user": null,
"doctor_clinic": [
{
"doctor_id": 1,
"clinic_id": 1,
"consultancy_fee": "12.00",
"deleted_at": null,
"workdays": [
{
"day": "sun",
"available": 1,
"workhours": [
{
"from": "09:28:00",
"to": "21:28:00"
}
]
}
],
"service": []
}
]
}
]
}
Now how can i find the doctors whose "about or specialty name" matches with some given search string.
Thanks in advance.
Try using dd() helper and use like this below
$youcollectionvariables = { "success": true, "doctor": [ { "id": 1, "name": "Dr. Mayank", "dob": "1975-01-01"................. }
dd($youcollectionvariables)
you will see a formatted data and can find what you need clearly.
Hope that helps.

Queries on ElasticSearch

I have a document which look like this,
{
"_index": "w3-commsvc",
"_type": "message",
"_id": "h98yv662",
"_score": 1,
"_source": {
"messageId": "h98yv662",
"campaignName": "src_checkoutAbandon",
"campaignId": "cId_w3_website",
"states": [
{
"Delivered": 790709218
},
{
"open": 1288775055
},
{
"click": 319518555
},
{
"DEFERRED": 2137606534
}
],
"clientName": "w3_website",
"templateId": "test",
"opens": [
{
"url": "www.something.com",
"id": "t26jj783",
"userAgent": {
"browser": {
"family": "IE",
"version": "11.0",
"major": "11",
"minor": "0",
"patch": null
},
"os": {
"family": "Windows_XP",
"version": null,
"versionPopularName": null,
"major": null,
"minor": null,
"patch": null,
"patchMinor": null
},
"device": {
"family": "Other",
"type": "Computer"
}
},
"timestamp": "1372366437"
},
{
"url": "www.something.com",
"id": "t98ef285",
"userAgent": {
"browser": {
"family": "IE",
"version": "11.0",
"major": "11",
"minor": "0",
"patch": null
},
"os": {
"family": "Windows_XP",
"version": null,
"versionPopularName": null,
"major": null,
"minor": null,
"patch": null,
"patchMinor": null
},
"device": {
"family": "Other",
"type": "Computer"
}
},
"timestamp": "717918284"
}
],
"clicks": [
{
"url": "www.something.com",
"id": " j60te707",
"userAgent": {
"browser": {
"family": "IE",
"version": "11.0",
"major": "11",
"minor": "0",
"patch": null
},
"os": {
"family": "Windows_XP",
"version": null,
"versionPopularName": null,
"major": null,
"minor": null,
"patch": null,
"patchMinor": null
},
"device": {
"family": "Other",
"type": "Computer"
}
},
"timestamp": "1293320728"
},
{
"url": "www.something.com",
"id": " c63bc623",
"userAgent": {
"browser": {
"family": "IE",
"version": "11.0",
"major": "11",
"minor": "0",
"patch": null
},
"os": {
"family": "Windows_XP",
"version": null,
"versionPopularName": null,
"major": null,
"minor": null,
"patch": null,
"patchMinor": null
},
"device": {
"family": "Other",
"type": "Computer"
}
},
"timestamp": "624917313"
},
{
"url": "www.something.com",
"id": " f10qm",
"userAgent": {
"browser": {
"family": "Firefox",
"version": "11.0",
"major": "11",
"minor": "0",
"patch": null
},
"os": {
"family": "Windows_XP",
"version": null,
"versionPopularName": null,
"major": null,
"minor": null,
"patch": null,
"patchMinor": null
},
"device": {
"family": "Other",
"type": "Computer"
}
},
"timestamp": "334734507"
}
]
}
}
Now using the above documents i need the following answer for the following queries,
1 - I need the terms count of each state for a certain clientName.
2 - Total sum of length of each opens array in the document.
3 - Open and click stats for each browsers.

Resources