Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-18243

add 'lfs df --output' option to print specific fields

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      As with "df", it would be useful to allow specifying "lfs df --output=FIELD_LIST" to print only specific fields from the output:

      FIELD_LIST is a comma-separated list of columns to be included. Valid
      field names are: 'source', 'itotal' (alias 'inodes'), 'iused', 'iavail' (alias 'ifree'),
      'ipcent' (alias 'iusepct'), 'size', 'used', 'free', 'avail', 'pcent' (alias 'usepct'), 'file' and 'target'

      This allows printing only specific fields, and would avoid a lot of "lfs df | awk '/OST0000/ { print $4 }'" kind of usage in test scripts, and is likely similarly useful for end users. The aliases are added to match the column headings reported by "df".

      It would also be useful to have long options for these, like "lfs df --itotal" or "lfs df --size" or "lfs df --usepct" so that they are accessible in an intuitive manner as needed.

      Attachments

        Issue Links

          Activity

            [LU-18243] add 'lfs df --output' option to print specific fields
            adilger Andreas Dilger made changes -
            Description Original: As with "{{{}df{}}}", it would be useful to allow specifying "{{{}lfs df --output={_}FIELD_LIST{_}{}}}" to print only specific fields from the output:
            {quote}{{_FIELD_LIST_}} is a comma-separated list of columns to be included. Valid
            field names are: 'source', 'itotal', 'iused', 'iavail',
            'ipcent', 'size', 'used', 'avail', 'pcent', 'file' and 'target'
            {quote}

            This allows printing only specific fields, and would avoid a lot of "{{lfs df | awk '/OST0000/ \{ print $4 \}'}}" kind of usage in test scripts, and is likely similarly useful for end users.
            New: As with "{{{}df{}}}", it would be useful to allow specifying "{{{}lfs df --output={_}FIELD_LIST{_}{}}}" to print only specific fields from the output:
            {quote}{{_FIELD_LIST_}} is a comma-separated list of columns to be included. Valid
            field names are: 'source', 'itotal' (alias 'inodes'), 'iused', 'iavail' (alias 'ifree'),
            'ipcent' (alias 'iusepct'), 'size', 'used', 'free', 'avail', 'pcent' (alias 'usepct'), 'file' and 'target'
            {quote}

            This allows printing only specific fields, and would avoid a lot of "{{lfs df | awk '/OST0000/ \{ print $4 \}'}}" kind of usage in test scripts, and is likely similarly useful for end users. The aliases are added to match the column headings reported by "{{df}}".

            It would also be useful to have long options for these, like "{{lfs df --itotal}}" or "{{lfs df --size}}" or "{{lfs df --usepct}}" so that they are accessible in an intuitive manner as needed.
            adilger Andreas Dilger made changes -
            Labels Original: easy lad24dd New: easy lad24dd utils
            adilger Andreas Dilger made changes -
            Link New: This issue is related to LU-18242 [ LU-18242 ]
            adilger Andreas Dilger created issue -

            People

              core-lustre-triage Core Lustre Triage
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: