openSUSE / openSUSE/supportutils

Move client logs in samba.txt after daemon logs

Open
#107 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Shell
Stars
35
Forks
70
Avg merge
5d 16h
Merged PRs (30d)
1

Description

IMO could we move client logs till the end of the samba.txt file? The file could be huge and sometimes searching for daemon log inside many client logs is annoying.

An example:

ls -lh samba.txt
-rw-r--r--+ 1 wwwrun www 39M Jun  9 15:09 samba.txt

# number of all logs included
grep -Po ' \K(/var/log/[^ ]+)(?=.*)' samba.txt  | wc -l
28574

# number of "client" logs
grep -Po ' \K(/var/log/samba/log\.[^ ]+)(?=.*)' samba.txt | \
  grep -P '^((?!(smbd|winbindd|wb-)).)*$' | wc -l
28549

# number of lines
 wc -l < samba.txt 
709882

# position of "non-client" logs
grep -nPo ' \K(/var/log/samba/log\.[^ ]+)(?=.*)' samba.txt | \
  grep -P '(smbd|winbindd|wb-)' | grep -v \.old$ | \
  sed -r 's/wb-(.*)/wb-<censored>/'
149941:/var/log/samba/log.smbd
150445:/var/log/samba/log.smbd_UNKNOWN_UNKNOWN
159657:/var/log/samba/log.winbindd
162911:/var/log/samba/log.wb-<censored>
171467:/var/log/samba/log.wb-<censored>
180489:/var/log/samba/log.wb-<censored>
235871:/var/log/samba/log.wb-<censored>
240121:/var/log/samba/log.wb-<censored>
246613:/var/log/samba/log.wb-<censored>
252190:/var/log/samba/log.wb-<censored>
278208:/var/log/samba/log.wb-<censored>
282410:/var/log/samba/log.wb-<censored>
325665:/var/log/samba/log.wb-<censored>
365150:/var/log/samba/log.winbindd-idmap
390960:/var/log/samba/log.wb-<censored>
400034:/var/log/samba/log.wb-<censored>
579271:/var/log/samba/log.wb-<censored>
581215:/var/log/samba/log.winbindd-dc-connect
581719:/var/log/samba/log.winbindd_UNKNOWN_UNKNOWN

As you can see one has to scroll a lot to get to some "non-client" logs.

Thus I would propose to reorder display of samba logs - first daemon logs, then "client" logs.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the code that generates samba.txt and collects or orders the listed Samba logs. Verify how daemon and client logs are identified, then confirm that generated output places all daemon logs before client logs while preserving the collected content.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.