Skip to content

Getting Filenames of files from a Google Cloud Storage #2519

Answered by mihaitodor
mark-cale asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @mark-cale 👋 If you only need the filenames, the gcp_cloud_storage input is going to be wasteful, since it will also read the contents of the files. If you also need the contents, then what I think you want is to look at the gcs_key metadata field. Try adding a log processor like so:

- log:
     message: |
       Filename: ${! @gcs_key }

You can also dump all the metadata fields if you just use @ instead of @gcs_key.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mark-cale
Comment options

Answer selected by mark-cale
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants