jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
531 stars 234 forks source link

request: jfrog rt s - allow to define include(<fields>) for aql search #320

Closed sdrzazga closed 1 year ago

sdrzazga commented 5 years ago

Hi. It would be extremely helpful if it was possible to define include() for an aql search like possible through REST. I want to define what field will be in the result JSON and not let jfrogcli decide this for me. Thanks in advance!

seanmmccormick commented 5 years ago

This would be extremely helpful. Can you add this to your Spec File language?

phonique commented 2 years ago

Resurrecting, since this would still be quite useful.

Michael-Masas commented 1 year ago

would be useful

jdfa commented 1 year ago

It would be useful for me, also here is old stackoverflow question about that: https://stackoverflow.com/questions/51246409/artifactory-aql-in-jfrog-rt-search-include-fields

sarao1310 commented 1 year ago

Hi all, We've released a new version that would support this issue so now you can use --include that allows you to define specific fields for aql search. Please let us know if you have any more issues or questions. And thank you for your feedback! 🐸

Opolonik commented 7 months ago

Hi, using "jf rt s --spec=<File Spec path> [command options]" with --include flag does not seem to work or change the actual output fields of the search prompt.

Example: debug.filespec looks like:

{
    "files": [
        {
            "aql": {
                "items.find": {
                    "repo": {"$eq": "aaa-generic-logs"},
                    "type": "folder",
                    "depth": "1",
                    "$and": [
                        {
                            "@marked_for_deletion": {"$nmatch": "*"}
                        }
                    ]
                }
            }
        }
    ]
}

Using following command:

jf rt s --spec files/debug.filespec --include="created_by"

Output:

13:05:57 [🔵Info] Searching artifacts...
13:05:58 [🔵Info] Found 3 artifacts.
[
  {
    "path": "aaa-generic-logs/test1",
    "type": "folder",
    "created": "2023-11-17T11:47:08.042+03:00",
    "modified": "2023-11-17T11:47:08.042+03:00"
  },
  {
    "path": "aaa-generic-logs/test2",
    "type": "folder",
    "created": "2023-11-23T16:21:58.297+03:00",
    "modified": "2023-11-23T16:21:58.297+03:00"
  },
  {
    "path": "aaa-generic-logs/test3",
    "type": "folder",
    "created": "2023-11-23T16:41:55.729+03:00",
    "modified": "2023-11-23T16:41:55.729+03:00"
  }
]
PaulAGH commented 7 months ago

I observed the same behavior as Opolonik using version 2.54.0. I also tried with --Include="name;repo;path;created_by" to no avail.

kabeero commented 3 months ago

even with v2.61.2 this problem persists

if you set

export JFROG_CLI_LOG_LEVEL=DEBUG

you will see jf completely ignores the --include directive and creates its own AQL query from the Filespec, with many more includes

nevesing commented 1 week ago

Does anyone have a work around for this?