feat(logs): add storage tier support for Flex logs#44
Merged
platinummonkey merged 1 commit intoFeb 11, 2026
Merged
Conversation
Adds --storage flag to all log search commands (search, list, query, aggregate) enabling users to query specific Datadog log storage tiers: indexes (standard), online-archives (long-term), and flex (cost-optimized). Changes: - Added logsStorage flag variable in cmd/logs_simple.go:548 - Implemented validateAndConvertStorageTier() helper function (cmd/logs_simple.go:685-705) - Added --storage flag to logs search, list, query, aggregate commands - Modified runLogsSearch(), runLogsList(), runLogsQuery(), runLogsAggregate() to validate and apply storage tier - Added comprehensive test coverage with 17 test cases in cmd/logs_simple_test.go - Updated docs/EXAMPLES.md with storage tier usage examples - Updated docs/COMMANDS.md with Flex logs example Features: - Validates storage tier before API calls for fast failure - Case-insensitive input handling (FLEX, flex, Flex all work) - Whitespace trimming for user convenience - Helpful error messages showing valid options - Backward compatible: omitting --storage searches all tiers (default behavior) Testing: - TestValidateAndConvertStorageTier: 9 test cases covering validation logic - TestRunLogsSearchWithStorageTier: 5 test cases for search command - TestRunLogsQueryWithStorageTier: 2 test cases for query command - TestRunLogsAggregateWithStorageTier: 1 test case for aggregate command - All tests pass with existing test suite - Full cmd package coverage maintained Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds --storage flag to all log search commands (search, list, query, aggregate) enabling users to query specific Datadog log storage tiers: indexes (standard), online-archives (long-term), and flex (cost-optimized).
Changes:
Features:
Testing:
Motivation
I wanted to be able to use the command line to search flex tier logs as that's not supported at the moment.
Checklist
Related Issues
I haven't created an issue for this - let me know if you'd like that before getting the PR.