-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Server.Enrichment.JsonLookup.yaml (#924)
artifact that allows pulling in JSON lists from an external URL
- Loading branch information
1 parent
53ba3bb
commit 459a165
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
content/exchange/artifacts/Server.Enrichment.JsonLookup.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Server.Enrichment.JsonLookup | ||
description: Allows pulling in JSON lists from an external URL to perform lookups against | ||
author: Whitney Champion (@shortxstack) | ||
type: SERVER | ||
|
||
parameters: | ||
- name: LookupUrl | ||
type: string | ||
default: | ||
|
||
sources: | ||
- query: | | ||
// Assumes JSON is formatted like this: | ||
// { | ||
// "list": | ||
// [ | ||
// {"key":"value"}, | ||
// {"key":"value"} | ||
// ] | ||
// } | ||
LET Data = SELECT parse_json(data=Content) AS Lookup | ||
FROM http_client(url=LookupUrl, headers=dict(`Accept`="application/json"), method='GET') | ||
SELECT | ||
Lookup.list AS Lookup | ||
FROM Data | ||
// | ||
// Notebook usage: | ||
// | ||
// LET List <= SELECT Lookup from Artifact.Custom.Server.Enrichment.JsonLookup(LookupUrl="https://") | ||
// SELECT * FROM foreach(row=array(array=List.Lookup)) | ||
// | ||