Essbase transaction logs.
ALG file is just pairs of timestamps and transaction descriptions:
ATX file holds the data as it was locked and sent:
Note: Entries in both files are expected to keep the same order. Based on these properties they can be parsed separately and joined via index. This method is beneficial, because row-count errors happen in ALG from time to time and are easier to spot if you don't follow ALG declarations when parsing transactions.
This namespace lets you process transaction logs, filter and pack results in a presentable way. Contains some basic predicates to aid that.
IMPORTANT:
Since you will most likely work with these files via text editor, or interact with people who will, to verify the results -- all indexing is 1-based, just to make your life a bit easier easier:
Whatever is the ALG declaration of starting position and rows -- we use that here to avoid any confusion while exchanging this data.
Essbase transaction logs. ALG file is just pairs of timestamps and transaction descriptions: * First two lines is the time stamp of when audit log was enabled. * Remaining pairs describe user and location+length in ATX file, line wise. ATX file holds the data as it was locked and sent: * Quoted member names, non-quoted values. * Data chunks are separated by empty lines. Note: Entries in both files are expected to keep the same order. Based on these properties they can be parsed separately and joined via index. This method is beneficial, because row-count errors happen in ALG from time to time and are easier to spot if you don't follow ALG declarations when parsing transactions. This namespace lets you process transaction logs, filter and pack results in a presentable way. Contains some basic predicates to aid that. IMPORTANT: Since you will most likely work with these files via text editor, or interact with people who will, to verify the results -- all indexing is 1-based, just to make your life a bit easier easier: * :line-no in header, physical line in ALG file; * :span in block, physical lines in ATX file; * :index in both is order number of it. Whatever is the ALG declaration of starting position and rows -- we use that here to avoid any confusion while exchanging this data.
(->block idx lines)
Consumes block index & indexed lines, returns a block.
Consumes block index & indexed lines, returns a block.
(->header idx two-line)
Consumes header index and lines, returns a header.
Consumes header index and lines, returns a header.
(between? date-time-from date-time-to)
Returns predicate that checks :head :timestamp against given interval.
Format required is DateTimeFormatter/ISO_DATE_TIME - 2017-05-24T21:08:28.458Z
Returns predicate that checks :head :timestamp against given interval. Format required is DateTimeFormatter/ISO_DATE_TIME - 2017-05-24T21:08:28.458Z
(blocks a-line-seq)
Consumes line-seq, returns sequence of blocks (via ->block).
Consumes line-seq, returns sequence of blocks (via ->block).
(correct-alg-drifts! source-alg source-atx target-alg)
(correct-alg-drifts! source-alg source-atx target-alg interceptor)
Write ALG copy with drifts fixed. Grabs file header and copies that as well.
Make sure you don't point target to source.
The interceptor will get fed result of correct-drifts with two ALG header lines cons'd. Should pass all inputs through, is for side effects, like logging, and defaults to identity.
Please be aware that this only works when drifts are caused by ALG entries that are not reflecting count of ATX ones. If any entries in any file were deleted or swapped places -- that is if the order of entries or their matching was affected -- this 'fix' will not be what you want. You might get an OK looking file, but its audit value is limited. Consider yourself warned.
Write ALG copy with drifts fixed. Grabs file header and copies that as well. Make sure you don't point target to source. The interceptor will get fed result of correct-drifts with two ALG header lines cons'd. Should pass all inputs through, is for side effects, like logging, and defaults to identity. Please be aware that this only works when drifts are caused by ALG entries that are not reflecting count of ATX ones. If any entries in any file were deleted or swapped places -- that is if the order of entries or their matching was affected -- this 'fix' will not be what you want. You might get an OK looking file, but its audit value is limited. Consider yourself warned.
(correct-drifts entries)
TxLog processor corrects the ALG to match ATX.
Returns fixed :raw lines from ALG. It does not return ALG header lines!
It attaches original entry as meta, so reporting can be done.
TxLog processor corrects the ALG to match ATX. Returns fixed :raw lines from ALG. It does not return ALG header lines! It attaches original entry as meta, so reporting can be done.
(data-matches? re-term)
Returns predicate that checks :data :block with given regexp.
Returns predicate that checks :data :block with given regexp.
(drifts entries)
TxLog reducing processor: at and rows issues in ALG/ATX as a map.
Only entries with issues are listed, relevant sub-maps are of shape:
{index (- alg-value atx-value)}
Fields:
:at-drift provides start position mismatch between ALG and ATX.
:rows-drift provides length mismatch between ALG and ATX.
:processed is the pair of first and last index of processed h+b.
TxLog reducing processor: at and rows issues in ALG/ATX as a map. Only entries with issues are listed, relevant sub-maps are of shape: {index (- alg-value atx-value)} Fields: :at-drift provides start position mismatch between ALG and ATX. :rows-drift provides length mismatch between ALG and ATX. :processed is the pair of first and last index of processed h+b.
(header+block header block)
Consumes header and block, merges the structure and adds control checks.
Consumes header and block, merges the structure and adds control checks.
Regular expression for ALG entries.
Regular expression for ALG entries.
Output format for ALG timestamp.
Output format for ALG timestamp.
(headers a-line-seq)
Consume line-seq, returns sequence of headers (via ->header).
Consume line-seq, returns sequence of headers (via ->header).
(list-drifts entries)
TxLog filtering processor: produce entries w/ issues in ALG/ATX.
It checks the :ctrl header for issues and only passes borked entries. Returns lazy sequence of entries.
TxLog filtering processor: produce entries w/ issues in ALG/ATX. It checks the :ctrl header for issues and only passes borked entries. Returns lazy sequence of entries.
(printable)
(printable picks)
Packs :head :raw and :data :block into ALG+ATX form.
Entry header occupies first two rows and first column, data is shifted one column to the right. It can be cleanly dumped as CSV/TSV and imported into a spreadsheet.
Called without arguments returns a transducer.
Packs :head :raw and :data :block into ALG+ATX form. Entry header occupies first two rows and first column, data is shifted one column to the right. It can be cleanly dumped as CSV/TSV and imported into a spreadsheet. Called without arguments returns a transducer.
(strict-header+block header block)
Executes header+block, then throws exception if any checks failed.
Executes header+block, then throws exception if any checks failed.
(tx-log)
(tx-log spec)
(tx-log spec source)
Will create an instance of TxLog. This instance defined io/in! call:
(io/in! tx-instance {:alg path-to-alg :atx path-to-atx})
Will create an instance of TxLog. This instance defined io/in! call: (io/in! tx-instance {:alg path-to-alg :atx path-to-atx})
(user-matches? re-term)
Returns predicate that checks :head :user against given regexp.
Returns predicate that checks :head :user against given regexp.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close