Skip to content

gnugmanov SNOW 2334154 sanssh clean output#593

Open
sfc-gh-gnugmanov wants to merge 2 commits intomainfrom
gnugmanov-SNOW-2334154-sanssh-clean-output
Open

gnugmanov SNOW 2334154 sanssh clean output#593
sfc-gh-gnugmanov wants to merge 2 commits intomainfrom
gnugmanov-SNOW-2334154-sanssh-clean-output

Conversation

@sfc-gh-gnugmanov
Copy link
Collaborator

@sfc-gh-gnugmanov sfc-gh-gnugmanov commented Sep 12, 2025

Add --clean-output to strip prefixed metadata from output lines
Add newline-aware cleaner GetCleanOutputWriter in services/util/writer
that removes everything up to the first space on each line
Wire cleaner into cmd/sanssh/client/client.go; apply cleaning before
optional prefixing (-h) so sanssh’s prefix remains intact
Add --clean-output flag in cmd/sanssh/main.go and pass via RunState
Mark --clean-output as important so it appears in sanssh help
Update examples/docs to reflect ${random-number}-${ip}:9500: prefix
format (dash between number and IP)
Add TestCleanWriter and keep existing writer tests passing
Usage:
./sanssh --targets=host1 --clean-output file read /var/log/app.log
Behavior:
"123-10.0.0.1:9500: some_output_strings" -> "some_output_strings"

@sfc-gh-gnugmanov sfc-gh-gnugmanov force-pushed the gnugmanov-SNOW-2334154-sanssh-clean-output branch from b682ca5 to 05c0569 Compare September 26, 2025 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments