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

Add --properties option to seqcli ingest and seqcli log #354

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

nblumhardt
Copy link
Member

Currently, seqcli log and seqcli ingest allow additional properties to be specified in -p Name=Value format:

seqcli log -m "Hello, {Name}" -p Name=User

This relies on sniffing the type of the property value to construct string, numeric, or Boolean property values in a reasonably intuitive manner.

However, there's no way to override the type used for the representation of a value, and no way to specify complex values such as service: {name: 'Test'} or tags: [1, 2, 3].

This PR is a proof-of-concept showing how we could use Seq.Syntax to construct strongly-typed property values:

seqcli log -m "Hello, {Name}" --properties="{Name: 'User', Tags: [1, 2, 3]}"

Each member in the result of evaluating --properties is added to the log event. A tricky "object spread" is used behind the scenes so that in the seqcli ingest case, properties on the original event being ingested can be removed with {someProperty: undefined()}.

Posting this here as a spike; some more work is needed on tests, and there's a bit of an unpleasant split in seqcli log due to the current implementation no longer relying on LogEvent behind the scenes.

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

Successfully merging this pull request may close these issues.

1 participant