Parsing array of objects using Logstash - elasticsearch

I have JMS message payload containing array of customer objects which needs to indexed into elastic search.
JMS Payload
{
"file": {
"header": {
"id": "13",
"name": "ElasticCustomer",
"description": "ElasticCustomer",
"version": "Version 1",
"exportID": "ElasticCustomer",
"exportInstance": "20200918043921264",
"extractionMode": "FULL",
"extractionDate": "2020-09-18T05:37:32"
},
"body": {
"records": [
{
"customerId": "NVS1200063862",
"URI": "https://data.novartis.net/r1/commercial/customer_management/customer_mdm/v1/customer/HCO/NVS1200063862",
"customerCountry": "200024",
"type": {
"linked_record": {
"code": "200027",
"description": "Health Care Organization",
"shortDescription": "HCO",
"remoteKeys": {
"linked_records": []
},
"technicalData": {
"lastUser": "chaoure1",
"creationTime": "2019-06-24T11:02:45",
"lastTime": "2019-06-24T11:02:45",
"primaryKey": "200027",
"foreignKey": "200027",
"linkedTable": "/root/ReferenceData"
}
}
},
"veevaRecordType": {
"recordTypeId": "012A0000000zC10IAE",
"recordTypeValue": "PH_CORE-Clinics"
},
"status": {
"linked_record": {
"code": "200036",
"description": "Active",
"shortDescription": null,
"remoteKeys": {
"linked_records": [
{
"system": "200073",
"systemKey": "STA.3",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "6099",
"linkedTable": "/root/RemoteKeys"
}
},
{
"system": "200072",
"systemKey": "Active",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "6351",
"linkedTable": "/root/RemoteKeys"
}
},
{
"system": "200071",
"systemKey": "Active",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "6353",
"linkedTable": "/root/RemoteKeys"
}
}
]
},
"technicalData": {
"lastUser": "chaoure1",
"creationTime": "2019-06-24T11:02:45",
"lastTime": "2019-06-24T11:02:45",
"primaryKey": "200036",
"foreignKey": "200036",
"linkedTable": "/root/ReferenceData"
}
}
},
"statusReason": {
"linked_record": {}
},
"hco": "HCO1200016052",
"hcp": null,
"healthCareOrganisation": {
"linked_records": []
},
"healthCareProfessional": {
"linked_records": []
},
"communication": {
"linked_records": [
{
"communicationId": 2739472,
"customerId": "NVS1200063862",
"communicationType": {
"linked_record": {
"code": "200146",
"description": "Communication Channel",
"shortDescription": null,
"remoteKeys": {
"linked_records": []
},
"technicalData": {
"lastUser": "chaoure1",
"creationTime": "2019-06-24T11:02:45",
"lastTime": "2019-06-24T11:02:45",
"primaryKey": "200146",
"foreignKey": "200146",
"linkedTable": "/root/ReferenceData"
}
}
},
"type": "212126",
"value": "519 2046052",
"status": {
"linked_record": {
"code": "200084",
"description": "Active",
"shortDescription": null,
"remoteKeys": {
"linked_records": []
},
"technicalData": {
"lastUser": "chaoure1",
"creationTime": "2019-06-24T11:02:45",
"lastTime": "2019-06-24T11:02:45",
"primaryKey": "200084",
"foreignKey": "200084",
"linkedTable": "/root/ReferenceData"
}
}
},
"isPrimary": false,
"technicalData": {
"lastUser": "sys_apimdmprod",
"creationTime": "2020-08-07T08:01:30",
"lastTime": "2020-08-07T08:01:30",
"primaryKey": "2739472",
"linkedTable": "/root/Communication"
}
}
]
},
"remoteKeys": {
"linked_records": []
},
"adresses": {
"linked_records": [
{
"addressId": 6748337,
"Identification": {
"customerId": "NVS1200063862",
"isPrimary": true,
"addressType": {
"linked_record": {
"code": "200148",
"description": "Primary address",
"shortDescription": null,
"remoteKeys": {
"linked_records": [
{
"system": "200072",
"systemKey": "Primary address",
"status": "AC",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "5412",
"linkedTable": "/root/RemoteKeys"
}
},
{
"system": "200071",
"systemKey": "Primary address",
"status": "AC",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "5417",
"linkedTable": "/root/RemoteKeys"
}
},
{
"system": "200073",
"systemKey": "TYS.P",
"status": "AC",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "5422",
"linkedTable": "/root/RemoteKeys"
}
}
]
},
"technicalData": {
"lastUser": "chaoure1",
"creationTime": "2019-06-24T11:02:45",
"lastTime": "2019-06-24T11:02:45",
"primaryKey": "200148",
"foreignKey": "200148",
"linkedTable": "/root/ReferenceData"
}
}
}
},
"AddressAttributes": {
"addressLine1": "D-590 Oxford St E",
"addressLine2": "D",
"addressLine3": null,
"city": "London",
"stateandprovince": {
"linked_record": {
"code": "213040",
"description": "ON",
"shortDescription": "ON",
"remoteKeys": {
"linked_records": [
{
"code": 6672,
"system": "200071",
"systemKey": "ON",
"status": "AC",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "6672",
"linkedTable": "/root/RemoteKeys"
}
},
{
"code": 6685,
"system": "200073",
"systemKey": "009",
"status": "AC",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "6685",
"linkedTable": "/root/RemoteKeys"
}
},
{
"code": 11365,
"system": "209336",
"systemKey": "ON",
"status": "AC",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "11365",
"linkedTable": "/root/RemoteKeys"
}
}
]
},
"technicalData": {
"lastUser": "chaoure1",
"creationTime": "2019-06-24T11:02:45",
"lastTime": "2019-06-24T11:02:45",
"primaryKey": "213040",
"foreignKey": "213040",
"linkedTable": "/root/ReferenceData"
}
}
},
"zip": "N5Y 3J1",
"country": {
"linked_record": {
"code": "200024",
"description": "Canada",
"shortDescription": "CA",
"remoteKeys": {
"linked_records": [
{
"system": "200071",
"systemKey": "Canada",
"status": "AC",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "6081",
"linkedTable": "/root/RemoteKeys"
}
},
{
"system": "200073",
"systemKey": "CA",
"status": "AC",
"technicalData": {
"lastUser": "moritda3",
"creationTime": "2020-04-22T19:48:08",
"lastTime": "2020-04-22T19:48:08",
"primaryKey": "6082",
"linkedTable": "/root/RemoteKeys"
}
}
]
},
"technicalData": {
"lastUser": "singhv2z",
"creationTime": "2019-06-24T11:02:45",
"lastTime": "2020-05-04T06:48:38",
"primaryKey": "200024",
"foreignKey": "200024",
"linkedTable": "/root/ReferenceData"
}
}
}
},
"AdditionalAttributes": {
"brick": "N5Y",
"microbrick": null,
"latitude": null,
"longitude": null,
"height": null,
"geographicCoordinates": null,
"masterAddress": null,
"effectiveDate": "2020-08-06",
"addressStatus": {
"linked_record": {
"code": "200003",
"description": "Active",
"shortDescription": null,
"remoteKeys": {
"linked_records": []
},
"technicalData": {
"lastUser": "chaoure1",
"creationTime": "2019-06-24T11:02:45",
"lastTime": "2019-06-24T11:02:45",
"primaryKey": "200003",
"foreignKey": "200003",
"linkedTable": "/root/ReferenceData"
}
}
},
"addressVerificationStatus": {
"linked_record": {
"code": "200032",
"description": "Verified",
"shortDescription": null,
"remoteKeys": {
"linked_records": []
},
"technicalData": {
"lastUser": "chaoure1",
"creationTime": "2019-06-24T11:02:45",
"lastTime": "2019-06-24T11:02:45",
"primaryKey": "200032",
"foreignKey": "200032",
"linkedTable": "/root/ReferenceData"
}
}
}
},
"technicalData": {
"lastUser": "sys_apimdmprod",
"creationTime": "2020-08-07T08:01:35",
"lastTime": "2020-08-07T08:01:35",
"primaryKey": "6748337",
"linkedTable": "/root/Address"
}
}
]
},
"education": {
"linked_records": []
},
"specialties": {
"linked_records": []
},
"consent": {
"linked_records": []
},
"credentials": {
"linked_records": []
},
"Affiliation": {
"customerParents": {
"linked_records": [
{
"affiliationId": 5977284,
"parentId": "NVS1200063862",
"childId": "NVS1000143585",
"affiliationType": {
"linked_record": {
"code": "200006",
"description": "HCO-HCP",
"shortDescription": null,
"remoteKeys": {
"linked_records": []
},
"technicalData": {
"lastUser": "chaoure1",
"creationTime": "2019-06-24T11:02:45",
"lastTime": "2019-06-24T11:02:45",
"primaryKey": "200006",
"foreignKey": "200006",
"linkedTable": "/root/ReferenceData"
}
}
},
"startDate": "2020-08-07",
"endDate": null,
"isPrimary": true,
"nanobrick": null,
"role": null,
"technicalData": {
"lastUser": "sys_apimdmprod",
"creationTime": "2020-08-07T08:01:55",
"lastTime": "2020-08-07T08:01:55",
"primaryKey": "5977284",
"linkedTable": "/root/Affiliation"
}
}
]
},
"customerChild": {
"linked_records": []
}
},
"additionalQualification": {
"linked_records": []
},
"statusComment": null,
"Tracking": {
"technicalRecordStatus": "PU",
"producerSystem": "OneKey",
"producerSystemRecordID": "WCAH00083151",
"transactionID": "WORKPLACE_execution3ab77e11c84a403aa12a33c53fafaa4520200807080051163",
"createdDate": "2020-08-07T08:01:27",
"createdBy": "OneKey",
"LastUpdatedDate": "2020-08-07T08:01:35",
"lastUpdateBy": "Api Gateway (sys_apimdmprod)",
"ApprovalDate": null,
"ApprovedBy": null,
"workflowID": null
},
"technicalData": {
"lastUser": "ebx-systemUser",
"creationTime": "2020-08-07T08:01:29",
"lastTime": "2020-09-17T15:41:04",
"primaryKey": "NVS1200063862"
}
}
]
},
"footer": {
"nb_records": 1
}
}
}
I want to create seperate upsert logstash event for each record in records array field.
My Current Logstash configuration looks like below
input
{
jms {
include_header => false
include_properties => false
include_body => true
use_jms_timestamp => false
destination => 'SpringBatchTestQueue'
pub_sub => false
jndi_name => '/JMS/CF/MDM'
jndi_context => {
'java.naming.factory.initial' => 'com.solacesystems.jndi.SolJNDIInitialContextFactory'
'java.naming.security.principal' => 'EDM_Test_User#NovartisDevVPN'
'java.naming.provider.url' => 'tcp://localhost:55555'
'java.naming.security.credentials' => 'EDM_Test_User'
}
require_jars=> ['/app/elasticsearch/jms/commons-lang-2.6.jar',
'/app/elasticsearch/jms/sol-jms-10.10.0.jar',
'/app/elasticsearch/jms/geronimo-jms_1.1_spec-1.1.1.jar']
}
}
filter{
json{
source => "message"
}
split {
field => "[file][body][records]"
}
}
output
{
elasticsearch
{
hosts => ["https://localhost:9200/"]
index => "test-%{+YYYY.MM.dd}"
document_id => "%{customerId}"
doc_as_upsert => true
ssl => true
ssl_certificate_verification => true
cacert => "/app/elasticsearch/config/ssl/Novartis_Silver_Three_Chain.pem"
}
}
Can anyone please let me know how each customerId in recordsfield can be indexed into ES using logstash?
Edit 1: As per answer suggested by Alcanzer.._id field is not populated correctly as well message contains unnecessary fields as well

You'll need to use the split filter to split on [file][body][records]. One use case of the split filter is to take an Array and create 1 event per element in the array.
You'd just add
split { field => "[file][body][records]" }
After your json filter.

Related

Logicapp expression with variable within expression giving null result

I am creating logicapp expression in which I need to substitute variable within the expression.
What what I want to achieve is : something like this
#{body('actionName')?['parentName1']?['2022-10-14:14']?['142.0'][0]?['ask']}
in the above expression, variable1 & variable2 holds 2022-10-14:14 & 142.0 respectively.
to achieve this, I am trying this below which is giving me null values
Trail-1:
#{body('actionName')?['parent1']?['#variables('dateVariable')']?['#variables('priceVariable')'][0]?['ask']}
Trail-2:
#{body('actionName')?['parent1']?['#variables("dateVariable")']?['#variables("priceVariable")'][0]?['ask']}
Trail-3:
#{body('actionName')?['parent1']?["#variables('dateVariable')"]?["#variables('priceVariable')"][0]?['ask']}
None of these trails worked, please let me know if you have any clue, many thanks in advance.
You need to remove your quotes.
Load this example into you tenant and it will show you a working example.
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Initialize_AUD_Property_Name": {
"inputs": {
"variables": [
{
"name": "AUD Property Name",
"type": "string",
"value": "AUD"
}
]
},
"runAfter": {
"Initialize_Currencies_Property_Name": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Initialize_Currencies_Property_Name": {
"inputs": {
"variables": [
{
"name": "Currencies Property Name",
"type": "string",
"value": "Currencies"
}
]
},
"runAfter": {
"Initialize_JSON_Object": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Initialize_JSON_Object": {
"inputs": {
"variables": [
{
"name": "JSON Object",
"type": "object",
"value": {
"altSpellings": [
"AU"
],
"area": 7692024,
"capital": [
"Canberra"
],
"capitalInfo": {
"latlng": [
-35.27,
149.13
]
},
"car": {
"side": "left",
"signs": [
"AUS"
]
},
"cca2": "AU",
"cca3": "AUS",
"ccn3": "036",
"cioc": "AUS",
"coatOfArms": {
"png": "https://mainfacts.com/media/images/coats_of_arms/au.png",
"svg": "https://mainfacts.com/media/images/coats_of_arms/au.svg"
},
"continents": [
"Oceania"
],
"currencies": {
"AUD": {
"name": "Australian dollar",
"symbol": "$"
}
},
"demonyms": {
"eng": {
"f": "Australian",
"m": "Australian"
},
"fra": {
"f": "Australienne",
"m": "Australien"
}
},
"fifa": "AUS",
"flag": "🇦🇺",
"flags": {
"png": "https://flagcdn.com/w320/au.png",
"svg": "https://flagcdn.com/au.svg"
},
"gini": {
"2014": 34.4
},
"idd": {
"root": "+6",
"suffixes": [
"1"
]
},
"independent": true,
"landlocked": false,
"languages": {
"eng": "English"
},
"latlng": [
-27,
133
],
"maps": {
"googleMaps": "https://goo.gl/maps/DcjaDa7UbhnZTndH6",
"openStreetMaps": "https://www.openstreetmap.org/relation/80500"
},
"name": {
"common": "Australia",
"nativeName": {
"eng": {
"common": "Australia",
"official": "Commonwealth of Australia"
}
},
"official": "Commonwealth of Australia"
},
"population": 25687041,
"postalCode": {
"format": "####",
"regex": "^(\\d{4})$"
},
"region": "Oceania",
"startOfWeek": "monday",
"status": "officially-assigned",
"subregion": "Australia and New Zealand",
"timezones": [
"UTC+05:00",
"UTC+06:30",
"UTC+07:00",
"UTC+08:00",
"UTC+09:30",
"UTC+10:00",
"UTC+10:30",
"UTC+11:30"
],
"tld": [
".au"
],
"translations": {
"ara": {
"common": "أستراليا",
"official": "كومونولث أستراليا"
},
"bre": {
"common": "Aostralia",
"official": "Kenglad Aostralia"
},
"ces": {
"common": "Austrálie",
"official": "Australské společenství"
},
"cym": {
"common": "Awstralia",
"official": "Cymanwlad Awstralia"
},
"deu": {
"common": "Australien",
"official": "Commonwealth Australien"
},
"est": {
"common": "Austraalia",
"official": "Austraalia Ühendus"
},
"fin": {
"common": "Australia",
"official": "Australian liittovaltio"
},
"fra": {
"common": "Australie",
"official": "Australie"
},
"hrv": {
"common": "Australija",
"official": "Commonwealth of Australia"
},
"hun": {
"common": "Ausztrália",
"official": "Ausztrál Államszövetség"
},
"ita": {
"common": "Australia",
"official": "Commonwealth dell'Australia"
},
"jpn": {
"common": "オーストラリア",
"official": "オーストラリア連邦"
},
"kor": {
"common": "호주",
"official": "오스트레일리아 연방"
},
"nld": {
"common": "Australië",
"official": "Gemenebest van Australië"
},
"per": {
"common": "استرالیا",
"official": "قلمرو همسود استرالیا"
},
"pol": {
"common": "Australia",
"official": "Związek Australijski"
},
"por": {
"common": "Austrália",
"official": "Comunidade da Austrália"
},
"rus": {
"common": "Австралия",
"official": "Содружество Австралии"
},
"slk": {
"common": "Austrália",
"official": "Austrálsky zväz"
},
"spa": {
"common": "Australia",
"official": "Mancomunidad de Australia"
},
"swe": {
"common": "Australien",
"official": "Australiska statsförbundet"
},
"tur": {
"common": "Avustralya",
"official": "Avustralya Federal Devleti"
},
"urd": {
"common": "آسٹریلیا",
"official": "دولتِ مشترکہ آسٹریلیا"
},
"zho": {
"common": "澳大利亚",
"official": "澳大利亚联邦"
}
},
"unMember": true
}
}
]
},
"runAfter": {},
"type": "InitializeVariable"
},
"Initialize_Name_Value": {
"inputs": {
"variables": [
{
"name": "Name Value",
"type": "string",
"value": "#{variables('JSON Object')?[variables('Currencies Property Name')]?[variables('AUD Property Name')]?['Name']}"
}
]
},
"runAfter": {
"Initialize_AUD_Property_Name": [
"Succeeded"
]
},
"type": "InitializeVariable"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"ParameterTest1": {
"defaultValue": "\"\"",
"type": "String"
}
},
"triggers": {
"manual": {
"inputs": {
"method": "GET",
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {}
}
Buried within there is an example expression that uses the names of the properties from a variable to extract the value.
Said expression looks like this (as you can see, no quotes) ...
variables('JSON Object')?[variables('Currencies Property Name')]?[variables('AUD Property Name')]?['Name']

Using loadable, common files are bundled into a common bundle

I am using loadable for code splitting. The problem is all my files which are being used in more than one file are bundle into my initial bundle which is making it too large. Instead I want them to be included in my particular route bundle which is opened. How can I solve this?
I want my files to be included in route bundle only. I don't want any common bundle.
This is my webpack config
{
"cache": true,
"context": "/src/client",
"entry": {
"desktop": "./app.desktop.jsx",
"mobile": "./app.mobile.jsx"
},
"output": {
"path": "repo_name/dist/js",
"pathinfo": false,
"publicPath": "https://{url}/js/",
"chunkFilename": "[contenthash].[name].js",
"filename": "[name].bundle.[contenthash].js"
},
"resolve": {
"alias": {},
"symlinks": true,
"plugins": [{
"source": "module",
"nmPath": "node_modules",
"originDir": "repo_name/node_modules/electrode-archetype-react-app-dev",
"target": "resolve"
}],
"modules": [
"repo_name/src",
"repo_name",
"node_modules"
],
"extensions": [
".js",
".jsx",
".json"
]
},
"resolveLoader": {
"symlinks": true,
"modules": [
"repo_name/lib",
"repo_name"
],
"plugins": [{
"source": "module",
"nmPath": "node_modules",
"originDir": "repo_name/node_modules/electrode-archetype-react-app-dev",
"target": "resolve"
}]
},
"module": {
"rules": [{
"test": {},
"use": [{
"loader": "repo_name/node_modules/babel-loader/lib/index.js",
"options": {
"cacheDirectory": "repo_name/.etmp/babel-loader"
}
}]
},
{
"test": {},
"use": [{
"loader": "repo_name/node_modules/mini-css-extract-plugin/dist/loader.js",
"options": {
"hmr": false,
"reload": false,
"publicPath": "/js/"
}
},
{
"loader": "repo_name/node_modules/css-loader/index.js",
"options": {
"context": "repo_name/src",
"modules": true,
"localIdentName": "[hash:base64:5]"
}
},
{
"loader": "repo_name/node_modules/postcss-loader/src/index.js",
"options": {
"ident": "postcss"
}
}
]
},
{
"test": {},
"use": [{
"loader": "repo_name/node_modules/mini-css-extract-plugin/dist/loader.js",
"options": {
"hmr": false,
"reload": false,
"publicPath": ""
}
},
{
"loader": "repo_name/node_modules/css-loader/index.js",
"options": {
"context": "repo_name/src",
"modules": true,
"localIdentName": "[hash:base64:5]"
}
},
{
"loader": "repo_name/node_modules/postcss-loader/src/index.js",
"options": {
"ident": "postcss"
}
},
{
"loader": "repo_name/node_modules/sass-loader/lib/loader.js"
}
]
},
{
"test": {},
"use": [{
"loader": "repo_name/node_modules/mini-css-extract-plugin/dist/loader.js",
"options": {
"hmr": false,
"reload": false,
"publicPath": ""
}
},
{
"loader": "repo_name/node_modules/css-loader/index.js",
"options": {
"context": "repo_name/src",
"modules": true,
"localIdentName": "[hash:base64:5]"
}
},
{
"loader": "repo_name/node_modules/postcss-loader/src/index.js",
"options": {
"ident": "postcss"
}
},
{
"loader": "repo_name/node_modules/stylus-relative-loader/index.js"
}
]
},
{
"test": {},
"use": [{
"loader": "repo_name/node_modules/url-loader/index.js",
"options": {
"limit": 1000,
"mimetype": "application/font-woff"
}
},
"repo_name/node_modules/isomorphic-loader/index.js"
]
},
{
"test": {},
"use": [
"repo_name/node_modules/file-loader/dist/cjs.js",
"repo_name/node_modules/isomorphic-loader/index.js"
]
},
{
"test": {},
"use": [{
"loader": "repo_name/node_modules/electrode-cdn-file-loader/index.js",
"options": {
"limit": 10000
}
},
"repo_name/node_modules/isomorphic-loader/index.js"
]
}
]
},
"plugins": [{
"options": {
"filename": "[name].style.[contenthash].css",
"chunkFilename": "[name].style.[contenthash].css"
},
"__name": "MiniCssExtractPlugin"
},
{
"pluginDescriptor": {
"name": "OptimizeCssAssetsWebpackPlugin"
},
"options": {
"assetProcessors": [{
"phase": "compilation.optimize-chunk-assets",
"regExp": {}
}],
"assetNameRegExp": {},
"cssProcessorOptions": {
"zindex": false
},
"cssProcessorPluginOptions": {}
},
"phaseAssetProcessors": {
"compilation.optimize-chunk-assets": [{
"phase": "compilation.optimize-chunk-assets",
"regExp": {}
}],
"compilation.optimize-assets": [],
"emit": []
},
"deleteAssetsMap": {},
"__name": "OptimizeCssAssetsWebpackPlugin"
},
{
"options": {
"minimize": true,
"options": {
"context": "repo_name/src"
},
"test": {}
},
"__name": "LoaderOptionsPlugin"
},
{
"opts": {
"filename": "../server/stats.json",
"fields": [
"assetsByChunkName",
"assets",
"entrypoints",
"chunks"
]
},
"__name": "StatsWriterPlugin"
},
{
"config": {
"valid": false
},
"options": {
"assetsFile": "../isomorphic-assets.json",
"configFile": "repo_name/.isomorphic-loader-config.json",
"webpackDev": {
"url": "http://localhost:2992",
"addUrl": false
}
},
"__name": "IsomorphicLoaderPlugin"
},
{
"opts": {
"filename": "../server/loadable-stats.json",
"outputAsset": true
},
"compiler": null,
"__name": "LoadablePlugin"
},
{
"resourceRegExp": {},
"newContentRegExp": {},
"__name": "ContextReplacementPlugin"
},
{
"sourceMapFilename": "../map/[file].map",
"sourceMappingURLComment": "\n//# sourceMappingURL=/map/[url]",
"moduleFilenameTemplate": "webpack://[namespace]/[resourcePath]",
"fallbackModuleFilenameTemplate": "webpack://[namespace]/[resourcePath]?[hash]",
"namespace": "",
"options": {
"filename": "../map/[file].map",
"append": "\n//# sourceMappingURL=/map/[url]"
},
"__name": "SourceMapDevToolPlugin"
},
{
"isWatch": true,
"__name": "FailPlugin"
},
{
"__name": "DonePlugin"
},
{
"opts": {
"analyzerMode": "server",
"analyzerHost": "127.0.0.1",
"analyzerPort": 8888,
"reportFilename": "report.html",
"defaultSizes": "parsed",
"openAnalyzer": true,
"generateStatsFile": false,
"statsFilename": "stats.json",
"statsOptions": null,
"excludeAssets": null,
"logLevel": "info",
"startAnalyzer": true
},
"server": null,
"logger": {
"activeLevels": {}
}
},
{
"options": {},
"timeEventData": {},
"smpPluginAdded": true
}
],
"mode": "production",
"optimization": {
"splitChunks": {
"cacheGroups": {
"node_vendors": {
"name": "node_vendor",
"test": {},
"chunks": "initial",
"priority": 1
},
"sentry": {
"name": "sentry",
"test": {},
"chunks": "all",
"priority": 10
}
}
}
}
}

From the below json data how can I print the tlds using foreach loop in laravel

Find below my json data and suggest me how to print the tld using foreach loop in laravel. Suggest me how to declare this array structure using foreach loop.
{
"result": "success",
"currency": {
"id": "1",
"code": "INR",
"prefix": " \u20b9",
"suffix": "INR",
"format": "1",
"rate": "1.00000"
},
"pricing": {
"in": {
"categories": [
"ccTLD",
"Geography"
],
"addons": {
"dns": true,
"email": true,
"idprotect": true
},
"group": "",
"register": {
"1": "704.39"
},
"transfer": {
"1": "704.39"
},
"renew": {
"1": "704.39"
}
},
"in.net": {
"categories": [
"Other"
],
"addons": {
"dns": true,
"email": true,
"idprotect": true
},
"group": "",
"register": {
"1": "547.69"
},
"transfer": {
"1": "547.69"
},
"renew": {
"1": "547.69"
}
},
"info": {
"categories": [
"gTLD",
"Popular"
],
"addons": {
"dns": true,
"email": true,
"idprotect": true
},
"group": "",
"register": {
"1": "861.10"
},
"transfer": {
"1": "861.10"
},
"renew": {
"1": "861.10"
}
},
"org": {
"categories": [
"gTLD",
"Popular"
],
"addons": {
"dns": true,
"email": true,
"idprotect": true
},
"group": "",
"register": {
"1": "939.45"
},
"transfer": {
"1": "939.45"
},
"renew": {
"1": "939.45"
}
},
"com": {
"categories": [
"gTLD",
"Popular"
],
"addons": {
"dns": true,
"email": true,
"idprotect": true
},
"group": "",
"register": {
"1": "740.43"
},
"transfer": {
"1": "740.43"
},
"renew": {
"1": "740.43"
}
},
"net": {
"categories": [
"gTLD",
"Popular"
],
"addons": {
"dns": true,
"email": true,
"idprotect": true
},
"group": "",
"register": {
"1": "829.76"
},
"transfer": {
"1": "829.76"
},
"renew": {
"1": "829.76"
}
},
"biz": {
"categories": [
"gTLD",
"Popular"
],
"addons": {
"dns": true,
"email": true,
"idprotect": true
},
"group": "",
"register": {
"1": "878.33"
},
"transfer": {
"1": "878.33"
},
"renew": {
"1": "878.33"
}
}
}
}
From the above data I wanted to display the tlds such as in,in.net,org,info,com,net,biz.
Use this:
$tlds = array_keys(json_decode($json, true)['pricing']);

i18n is not working in sapui5. (wp8)

My i18n is not working, I don't know what is wrong, below my manifest.json:
{
"_version": "1.1.0",
"sap.app": {
"_version": "1.1.0",
"id": "de.pensware.ui5StocksApp",
"type": "application",
"i18n": "i18n/i18n.properties"
},
"sap.ui": {
"technology": "UI5",
"icons": {
"icon": "",
"favIcon": "",
"phone": "",
"phone#2": "",
"tablet": "",
"tablet#2": ""
},
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
},
"supportedThemes": [
"sap_bluecrystal"
]
},
"sap.ui5": {
"_version": "1.1.0",
"rootView": {
"viewName": "de.pensware.ui5StocksApp.view.App",
"type": "XML"
},
"dependencies": {
"minUI5Version": "1.30.0",
"libs": {
"sap.ui.core": {},
"sap.m": {},
"sap.ui.layout": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "de.pensware.ui5StocksApp.i18n.i18n"
}
}
},
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"viewPath": "de.pensware.ui5StocksApp.view",
"controlId": "app",
"controlAggregation": "pages",
"transition": "slide"
},
"routes": [{
"name": "login",
"pattern": "",
"target": "login"
}],
"targets": {
"login": {
"viewName": "Login",
"viewId": "Login"
}
}
}
}
}
In my aplication I have a folder called i18n and the i18n.properties file.
In My view I have :
<Page title="{i18n>appTitle}">
But when I execute the app in a mobile windows phone it's not showing me the corresponding text traslation, it is showing only "appTitle" value.

Last password change date/time for user in Google Apps directory API

I'm trying to find the last password change date. I see it in the admin console when editing a user:
However, none of the metadata listings show an entry for the last password change date: https://developers.google.com/admin-sdk/directory/v1/guides/manage-users
{
"kind": "directory#users",
"users": [
{
"kind": "directory#user",
"id": "the unique user id",
"primaryEmail": "liz#example.com",
"name": {
"givenName": "Liz",
"familyName": "Smith",
"fullName": "Liz Smith"
},
"isAdmin": true,
"isDelegatedAdmin": false,
"lastLoginTime": "2013-02-05T10:30:03.325Z",
"creationTime": "2010-04-05T17:30:04.325Z",
"agreedToTerms": true,
"hashFunction: "SHA-1",
"suspended": false,
"changePasswordAtNextLogin": false,
"ipWhitelisted": false,
"ims": [
{
"type": "work",
"protocol": "gtalk",
"im": "lizim#talk.example.com",
"primary": true
}
],
"emails": [
{
"address": "liz#example.com",
"type": "work",
"customType": "",
"primary": true
}
],
"addresses": [
{
"type": "work",
"customType": "",
"streetAddress": "1600 Amphitheatre Parkway",
"locality": "Mountain View",
"region": "CA",
"postalCode": "94043"
}
],
"externalIds": [
{
"value": "employee number",
"type": "custom",
"customType": "office"
}
],
"relations": [
{
"value": "susan",
"type": "friend",
"customType": ""
}
],
"organizations": [
{
"name": "Google Inc.",
"title": "SWE",
"primary": true,
"customType": "",
"description": "Software engineer"
}
],
"phones": [
{
"value": "+1 nnn nnn nnnn",
"type": "work"
}
],
"aliases": [
"lizsmith#example.com",
"lsmith#example.com"
],
"nonEditableAliases: [
"liz#test.com"
],
"customerId": "C03az79cb",
"orgUnitPath": "corp/engineering",
"isMailboxSetup": true,
"includeInGlobalAddressList": true
},
{
"kind": "directory#user",
"id": "user unique ID",
"primaryEmail": "admin2#example.com",
"name": {
"givenName": "admin",
"familyName": "two",
"fullName": "admin two"
},
"isAdmin": true,
"isDelegatedAdmin": true,
"lastLoginTime": "2013-02-05T10:30:03.325Z",
"creationTime": "2010-04-05T17:30:04.325Z",
"agreedToTerms": true,
"hashFunction: "SHA-1",
"suspended": true,
"suspensionReason": "ADMIN",
"changePasswordAtNextLogin": false,
"ipWhitelisted": false,
"emails": [
{
"address": "admin2#example.com",
"type": "work",
"customType": "",
"primary": true
}
],
"externalIds": [
{
"value": "contractor license number",
"type": "custom",
"customType": "work"
}
],
"relations": [
{
"value": "liz",
"type": "friend",
"customType": ""
}
],
"aliases": [
"second_admin#example.com"
],
"nonEditableAliases: [
"admin#test.com"
],
"customerId": "C03az79cb",
"orgUnitPath": "corp/engineering",
"isMailboxSetup": true,
"includeInGlobalAddressList": true
}
],
"nextPageToken": "next page token"
}
I'm specifically using C# and the google apps directory API.
Anyone know where this field is located and/or how to access it?

Resources