MarkLogic Data Hub document metadata added by steps

Viewed 60

According to the documentation:

Document metadata added by steps

For every content object outputted by a Data Hub step, regardless of the step type, Data Hub will add the following document metadata keys and values to the document wrapped by the content object:

  • datahubCreatedOn = the date and time at which the document is written
  • datahubCreatedBy = the MarkLogic user used to run the step
  • datahubCreatedInFlow = the name of the flow containing the step being run
  • datahubCreatedByStep = the name of the step being run
  • datahubCreatedByJob = the ID of the job being run; this will contain the job ID of every flow run on the step, with multiple values being space-delimited

Is there any possibility to add some extra metadata keys and values to the document?

1 Answers

It is possible to add additional static values in your headers options or use one of these keywords to dynamically add values.

{
    "headers": {
        "sources": [{
            "name": "loadCustomersJSON"
        }],
        "createdOn": "datahubCreatedOn",
        "createdBy": "datahubCreatedBy"
    }
}

You can also dynamically add values by using an interceptor (See: https://docs.marklogic.com/datahub/5.6/flows/about-interceptors-custom-hooks.html) or updating the header value in a custom step if you are already using one (See:https://docs.marklogic.com/datahub/5.6/modules/editing-custom-step-module.html

Related