Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move client logs in samba.txt after daemon logs #107

Open
jirib opened this issue Jun 10, 2021 · 3 comments
Open

Move client logs in samba.txt after daemon logs #107

jirib opened this issue Jun 10, 2021 · 3 comments

Comments

@jirib
Copy link

jirib commented Jun 10, 2021

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.

@g23guy
Copy link
Collaborator

g23guy commented Jul 28, 2021

Sounds good.

@g23guy
Copy link
Collaborator

g23guy commented Aug 4, 2021

After reviewing supportconfig, I just get all files in the /var/log/samba directory without regard to order. I could get the file list and search for server logs, add them, and then add all the rest after that. Which specifically are the server log filenames that need to be positioned first?

@Thr3d
Copy link
Collaborator

Thr3d commented Jul 10, 2024

@jirib Can you give an example of the "client" logs you're filtering out?
IIUC you want to have the daemon/sub logs like smbd|winbindd|wb- above anything else in the directory?

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

No branches or pull requests

3 participants