Skip to content

Keep specified attribute ordering with '--attrs' when outputing to JSON #18

@maaaaz

Description

@maaaaz

@ropnop, here's a tiny feature asked: could it be possible to keep, in the output JSON file, the ordering of the specified attributes with the --attrs option ?

More precisely:

  • Here, I asked for specific attributes, in a specific order, which is honored by standard output ("dn" comes before "cn") :
$ ./windapsearch-linux-amd64 --dc 1.2.3.4 -u "user1@adyolo" -p "password" -m users --attrs dn,cn
dn: CN=foo,CN=bar,DC=ADYOLO,DC=SWAG
cn: user1
  • But with JSON output, the asked order is not kept : "cn" is printed before "dn" (which is the regular JSON order), but I wanted "dn" before "cn"
$ ./windapsearch-linux-amd64 --dc 1.2.3.4 -u "user1@adyolo" -p "password" -m users --attrs dn,cn -j
[{"cn":"user1","dn":"CN=foo,CN=bar,DC=ADYOLO,DC=SWAG"}
...

Cheers !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions