I've got a JSON array I ingest that I want to extract certain fields from to save into a lookup table.
Here's an example of the JSON:
{
"Response": {
"results": [
{
"memberType": 2,
"isOnline": false,
"lastOnlineStatusChange": "1657176499",
"groupId": "1234567",
"destinyUserInfo": {
"LastSeenDisplayName": "UserName1",
"LastSeenDisplayNameType": 1,
"iconPath": "/img/theme/bungienet/icons/xboxLiveLogo.png",
"crossSaveOverride": 1,
"applicableMembershipTypes": [
2,
1
],
"isPublic": false,
"membershipType": 1,
"membershipId": "1234567890123456789",
"displayName": "UserName1",
"bungieGlobalDisplayName": "UserName1",
"bungieGlobalDisplayNameCode": 9999
},
"bungieNetUserInfo": {
"supplementalDisplayName": "UserName1#9999",
"iconPath": "/img/profile/avatars/default_avatar.gif",
"crossSaveOverride": 0,
"isPublic": false,
"membershipType": 254,
"membershipId": "12345678",
"displayName": "UserName1",
"bungieGlobalDisplayName": "UserName1",
"bungieGlobalDisplayNameCode": 9999
},
"joinDate": "2021-10-27T20:56:48Z"
},
{
"memberType": 2,
"isOnline": false,
"lastOnlineStatusChange": "1657390180",
"groupId": "1234567",
"destinyUserInfo": {
"LastSeenDisplayName": "UserName2",
"LastSeenDisplayNameType": 1,
"iconPath": "/img/theme/bungienet/icons/xboxLiveLogo.png",
"crossSaveOverride": 1,
"applicableMembershipTypes": [
2,
3,
1
],
"isPublic": false,
"membershipType": 1,
"membershipId": "4611686018431599324",
"displayName": "UserName2",
"bungieGlobalDisplayName": "UserName2",
"bungieGlobalDisplayNameCode": 8888
},
"bungieNetUserInfo": {
"supplementalDisplayName": "UserName2#8888",
"iconPath": "/img/profile/avatars/HaloRingcopy.gif",
"crossSaveOverride": 0,
"isPublic": false,
"membershipType": 254,
"membershipId": "1990219",
"displayName": "UserName2",
"bungieGlobalDisplayName": "UserName2",
"bungieGlobalDisplayNameCode": 8888
},
"joinDate": "2020-04-07T15:07:21Z"
}
],
"totalResults": 2,
"hasMore": true,
"query": {
"itemsPerPage": 2,
"currentPage": 1
},
"useTotalResults": true
},
"ErrorCode": 1,
"ThrottleSeconds": 0,
"ErrorStatus": "Success",
"Message": "Ok",
"MessageData": {}
}
(I truncated the results array to 2, there are normally many more) I want to write to a lookup table like this:
_time | membershipId | joinDate
2022-07-17 16:20:28 | 1234567890123456789 | 2021-10-27T20:56:48Z
2022-07-17 16:20:28 | 9876543210123456789 | 2020-04-07T15:07:21Z
I can get something close into a table with:
index=myindex
| rename Response.results{}.destinyUserInfo.membershipId as membershipId Response.results{}.joinDate as JoinDate
| table _time ID JoinDate
but saving that to a lookup table makes the membershipId and joinDate into multivalue fields and stores all of the values accordingly. I need them separate. Help?
... View more