Skip to content

Commit

Permalink
Order columns in hostname flatten output (#2939)
Browse files Browse the repository at this point in the history
  • Loading branch information
scudette committed Sep 10, 2023
1 parent 89da84b commit 82f2cad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions artifacts/definitions/Generic/System/HostsFile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ sources:
- name: Hosts
query: |
SELECT OSPath, Address,
filter(list= (Hostname, ) + Aliases, regex=HostnameRegex) AS Hostname,
(Hostname, ) + Aliases AS Hostname,
Comment
FROM HostsFiles
WHERE Hostname AND Address =~ AddressRegex
WHERE Hostname =~ HostnameRegex
AND Address =~ AddressRegex
- name: HostsFlattened
query: |
SELECT * FROM flatten(query={
SELECT OSPath, Address, Hostname, Comment
FROM flatten(query={
SELECT OSPath, Address, (Hostname, ) + Aliases AS Hostname, Comment
FROM HostsFiles
})
Expand Down
3 changes: 2 additions & 1 deletion artifacts/testdata/server/testcases/hostsfile.out.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ SELECT * FROM Artifact.Windows.System.HostsFile( HostsFile=srcDir + '/artifacts/
{
"Address": "127.0.3.4",
"Hostname": [
"second.com"
"second.com",
"standardcomment2.com"
],
"Comment": "testing standard comment"
}
Expand Down

0 comments on commit 82f2cad

Please sign in to comment.