Skip to content

alias: handle input, output, filter, and processor plugin aliases#11656

Open
cosmo0920 wants to merge 11 commits into
masterfrom
comso0920-handle-plugin-aliases
Open

alias: handle input, output, filter, and processor plugin aliases#11656
cosmo0920 wants to merge 11 commits into
masterfrom
comso0920-handle-plugin-aliases

Conversation

@cosmo0920
Copy link
Copy Markdown
Contributor

@cosmo0920 cosmo0920 commented Apr 2, 2026

We can instantiate out_es as output elasticsearch plugin but the input of elasticsearch plugin is in_elasticsearch.
To maintain naming coherence, we need to handle plugin alias at least of out_es as out_elasticsearch.

With this patch, we can instantiate out_elasticsearch as out_es.

Closes #9261.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
[SERVICE]
    Flush               10

[INPUT]
    Name                dummy
    Dummy               { "message" : "this is dummy data" }
    Rate                10

[OUTPUT]
    Workers             4
    Name                elasticsearch
    Host                localhost
    Port                9201
    TLS                 On
    tls.verify_hostname On
    tls.ca_file         <your_cert>
    tls.vhost           your-elasticsearch-host
    Retry_Limit         6
    Replace_Dots        On
    Suppress_Type_Name  On
    HTTP_User           elastic
    HTTP_Passwd         elastic
    Index               fluent-bit
  • Debug log output from testing the change
Fluent Bit v5.0.2
* Copyright (C) 2015-2026 The Fluent Bit Authors
* Fluent Bit is a CNCF graduated project under the Fluent organization
* https://fluentbit.io

______ _                  _    ______ _ _           _____  _____ 
|  ___| |                | |   | ___ (_) |         |  ___||  _  |
| |_  | |_   _  ___ _ __ | |_  | |_/ /_| |_  __   _|___ \ | |/' |
|  _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / /   \ \|  /| |
| |   | | |_| |  __/ | | | |_  | |_/ / | |_   \ V //\__/ /\ |_/ /
\_|   |_|\__,_|\___|_| |_|\__| \____/|_|\__|   \_/ \____(_)\___/


[2026/04/02 19:46:50.277] [ info] Configuration:
[2026/04/02 19:46:50.298] [ info]  flush time     | 10.000000 seconds
[2026/04/02 19:46:50.306] [ info]  grace          | 5 seconds
[2026/04/02 19:46:50.306] [ info]  daemon         | 0
[2026/04/02 19:46:50.306] [ info] ___________
[2026/04/02 19:46:50.307] [ info]  inputs:
[2026/04/02 19:46:50.307] [ info]      dummy
[2026/04/02 19:46:50.308] [ info] ___________
[2026/04/02 19:46:50.308] [ info]  filters:
[2026/04/02 19:46:50.308] [ info] ___________
[2026/04/02 19:46:50.309] [ info]  outputs:
[2026/04/02 19:46:50.309] [ info]      es.0
[2026/04/02 19:46:50.309] [ info] ___________
[2026/04/02 19:46:50.310] [ info]  collectors:
[2026/04/02 19:46:50.372] [ info] [fluent bit] version=5.0.2, commit=4efcaf7d0e, pid=2864687
[2026/04/02 19:46:50.380] [debug] [engine] coroutine stack size: 24576 bytes (24.0K)
[2026/04/02 19:46:50.385] [ info] [storage] ver=1.5.4, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2026/04/02 19:46:50.386] [ info] [simd    ] SSE2
[2026/04/02 19:46:50.386] [ info] [cmetrics] version=2.1.1
[2026/04/02 19:46:50.386] [ info] [ctraces ] version=0.7.1
[2026/04/02 19:46:50.400] [ info] [input:dummy:dummy.0] initializing
[2026/04/02 19:46:50.401] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2026/04/02 19:46:50.402] [debug] [dummy:dummy.0] created event channels: read=21 write=22
[2026/04/02 19:46:50.419] [debug] [es:es.0] created event channels: read=23 write=24
[2026/04/02 19:46:50.784] [debug] [output:es:es.0] host=localhost port=9201 uri=/_bulk index=fluent-bit type=_doc
[2026/04/02 19:46:50.859] [ info] [sp] stream processor started
[2026/04/02 19:46:50.861] [ info] [engine] Shutdown Grace Period=5, Shutdown Input Grace Period=2
[2026/04/02 19:46:50.899] [ info] [output:es:es.0] worker #2 started
[2026/04/02 19:46:50.900] [ info] [output:es:es.0] worker #0 started
[2026/04/02 19:46:50.899] [ info] [output:es:es.0] worker #1 started
[2026/04/02 19:46:50.902] [ info] [output:es:es.0] worker #3 started
[2026/04/02 19:47:00.017] [debug] [task] created task=0x986bcb0 id=0 OK
[2026/04/02 19:47:00.019] [debug] [output:es:es.0] task_id=0 assigned to thread #0
[2026/04/02 19:47:00.590] [debug] [upstream] KA connection #69 to localhost:9201 is connected
[2026/04/02 19:47:00.606] [debug] [out_es] converted_size is 0
[2026/04/02 19:47:00.609] [debug] [out_es] converted_size is 0
[2026/04/02 19:47:00.611] [debug] [http_client] not using http_proxy for header
[2026/04/02 19:47:00.678] [debug] [output:es:es.0] HTTP Status=200 URI=/_bulk
[2026/04/02 19:47:00.689] [debug] [output:es:es.0] Elasticsearch response
{"errors":false,"took":0,"items":[{"create":{"_index":"fluent-bit","_id":"Re7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":646,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"Ru7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":647,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"R-7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":648,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"SO7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":649,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"Se7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":650,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"Su7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":651,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"S-7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":652,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"TO7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":653,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"Te7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":654,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"Tu7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":655,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"T-7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":656,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"UO7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":657,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"Ue7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":658,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"Uu7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":659,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"U-7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":660,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"VO7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":661,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"Ve7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":662,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"Vu7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":663,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"V-7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":664,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"WO7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":665,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"We7NTZ0BckMZbRRnt-0m","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":666,"_primary_term":
[2026/04/02 19:47:00.693] [debug] [upstream] KA connection #69 to localhost:9201 is now available
[2026/04/02 19:47:00.695] [debug] [out flush] cb_destroy coro_id=0
[2026/04/02 19:47:00.704] [debug] [task] destroy task=0x986bcb0 (task_id=0)
^C[2026/04/02 19:47:01] [engine] caught signal (SIGINT)
[2026/04/02 19:47:01.244] [debug] [task] created task=0x9c03d10 id=0 OK
[2026/04/02 19:47:01.245] [debug] [output:es:es.0] task_id=0 assigned to thread #1
[2026/04/02 19:47:01.245] [ warn] [engine] service will shutdown in max 5 seconds
[2026/04/02 19:47:01.246] [debug] [engine] task 0 already scheduled to run, not re-scheduling it.
[2026/04/02 19:47:01.246] [ info] [engine] pausing all inputs..
[2026/04/02 19:47:01.247] [ info] [input] pausing dummy.0
[2026/04/02 19:47:01.279] [debug] [upstream] KA connection #70 to localhost:9201 is connected
[2026/04/02 19:47:01.280] [debug] [http_client] not using http_proxy for header
[2026/04/02 19:47:01.312] [debug] [output:es:es.0] HTTP Status=200 URI=/_bulk
[2026/04/02 19:47:01.313] [debug] [output:es:es.0] Elasticsearch response
{"errors":false,"took":0,"items":[{"create":{"_index":"fluent-bit","_id":"oe7NTZ0BckMZbRRnue2j","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":738,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"ou7NTZ0BckMZbRRnue2j","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":739,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"o-7NTZ0BckMZbRRnue2j","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":740,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"pO7NTZ0BckMZbRRnue2j","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":741,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"pe7NTZ0BckMZbRRnue2j","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":742,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"pu7NTZ0BckMZbRRnue2j","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":743,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"p-7NTZ0BckMZbRRnue2j","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":744,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"qO7NTZ0BckMZbRRnue2j","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":745,"_primary_term":1,"status":201}},{"create":{"_index":"fluent-bit","_id":"qe7NTZ0BckMZbRRnue2j","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":746,"_primary_term":1,"status":201}}]}
[2026/04/02 19:47:01.313] [debug] [upstream] KA connection #70 to localhost:9201 is now available
[2026/04/02 19:47:01.313] [debug] [out flush] cb_destroy coro_id=0
[2026/04/02 19:47:01.314] [debug] [task] destroy task=0x9c03d10 (task_id=0)
[2026/04/02 19:47:02.012] [ info] [engine] service has stopped (0 pending tasks)
[2026/04/02 19:47:02.013] [ info] [input] pausing dummy.0
[2026/04/02 19:47:02.016] [ info] [output:es:es.0] thread worker #0 stopping...
[2026/04/02 19:47:02.035] [ info] [output:es:es.0] thread worker #0 stopped
[2026/04/02 19:47:02.056] [ info] [output:es:es.0] thread worker #1 stopping...
[2026/04/02 19:47:02.057] [ info] [output:es:es.0] thread worker #1 stopped
[2026/04/02 19:47:02.057] [ info] [output:es:es.0] thread worker #2 stopping...
[2026/04/02 19:47:02.058] [ info] [output:es:es.0] thread worker #2 stopped
[2026/04/02 19:47:02.058] [ info] [output:es:es.0] thread worker #3 stopping...
[2026/04/02 19:47:02.058] [ info] [output:es:es.0] thread worker #3 stopped
  • Attached Valgrind output that shows no leaks or memory corruption was found
==2864687== 
==2864687== HEAP SUMMARY:
==2864687==     in use at exit: 0 bytes in 0 blocks
==2864687==   total heap usage: 20,719 allocs, 20,719 frees, 9,198,473 bytes allocated
==2864687== 
==2864687== All heap blocks were freed -- no leaks are possible
==2864687== 
==2864687== For lists of detected and suppressed errors, rerun with: -s
==2864687== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • New Features

    • Plugin aliasing: refer to output plugins by friendly names (e.g., "elasticsearch" → "es") during selection.
    • Automatic URI rewriting: alias-style connection strings are rewritten to canonical plugin identifiers at instantiation.
  • Improvements

    • Network address parsing correctly handles URIs with scheme prefixes when extracting host/port.
  • Bug Fixes

    • Improved cleanup and error handling when alias rewriting or network parsing fail.
  • Tests

    • Added unit tests for alias lookup, URI rewrite, address parsing, and plugin instantiation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a plugin-alias subsystem: public header and implementation for alias lookup and URI rewriting, integrates alias handling into output creation and network parsing, updates build/test files, and adds unit tests for alias lookup, rewrite, parsing, and instantiation.

Changes

Cohort / File(s) Summary
Public API
include/fluent-bit/flb_plugin_alias.h
New header exposing FLB_PLUGIN_ALIAS_ERR, flb_plugin_alias_get() and flb_plugin_alias_rewrite() for alias lookup and rewrite.
Alias implementation
src/flb_plugin_alias.c, src/CMakeLists.txt
New source implementing alias table and rewrite behavior; added to build sources so it's compiled into libraries.
Output integration
src/flb_output.c
Uses alias lookup in check_protocol(); flb_output_new() uses rewritten output name/URI for selection and rewrites network outputs via flb_plugin_alias_rewrite() with explicit cleanup on FLB_PLUGIN_ALIAS_ERR.
Network parsing
src/flb_network.c
flb_net_host_set() now detects and skips an optional "://" scheme when locating host/port start.
Tests & build
tests/internal/plugin_alias.c, tests/internal/CMakeLists.txt
Added unit tests for alias lookup, rewrite, address parsing, and output instantiation; test added to internal CMake test list.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant OutputLayer as Output Layer
    participant AliasResolver as Alias Resolver
    participant NetworkLayer as Network Layer
    participant Plugin as Plugin

    User->>OutputLayer: flb_output_new(config, "elasticsearch")
    OutputLayer->>AliasResolver: flb_plugin_alias_rewrite(FLB_PLUGIN_OUTPUT, "elasticsearch://host:port")
    AliasResolver->>AliasResolver: extract scheme/alias, lookup "elasticsearch"
    AliasResolver-->>OutputLayer: "es://host:port" or FLB_PLUGIN_ALIAS_ERR or NULL
    alt rewritten URI returned
        OutputLayer->>NetworkLayer: flb_net_host_set("es://host:port")
    else no rewrite (NULL)
        OutputLayer->>NetworkLayer: flb_net_host_set("elasticsearch://host:port")
    else FLB_PLUGIN_ALIAS_ERR
        OutputLayer-->>User: return error (cleanup and NULL)
    end
    NetworkLayer->>NetworkLayer: detect "://", parse host and port
    NetworkLayer-->>OutputLayer: host/port populated
    OutputLayer->>Plugin: instantiate plugin with canonical name "es"
    Plugin-->>User: plugin instance returned
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I nibbled names from near and far,

swapped "elasticsearch" to "es" by star,
I stitched URIs with a careful hop,
parsed hosts and ports without a stop,
now plugins find the names on top.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ⚠️ Warning The title claims to handle aliases for input, output, filter, and processor plugins, but the changeset only implements output plugin aliases (elasticsearch/es), with no input, filter, or processor alias support present. Either implement aliases for all mentioned plugin types or revise the title to accurately reflect that only output plugin aliases are being added (e.g., 'alias: output: handle plugin aliases').
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully implements alias handling for the Elasticsearch output plugin, allowing it to be referenced as 'elasticsearch' while maintaining compatibility with the existing 'es' shorthand, directly addressing issue #9261.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing plugin alias support: new alias header/implementation, CMake integration, network parsing adjustments, and output plugin modifications are all necessary for the alias feature.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch comso0920-handle-plugin-aliases

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@include/fluent-bit/flb_plugin_alias.h`:
- Around line 25-27: flb_plugin_alias_rewrite currently returns NULL for both
“no rewrite needed” and allocation/build failures; change its API and
implementation so callers can distinguish errors: return NULL only for “no
rewrite”, return a distinct sentinel pointer (e.g. (char *)-1 or a named macro
like FLB_PLUGIN_ALIAS_ERR) to indicate allocation/build failure, and continue
returning a real allocated string on success; update callers (e.g. the code that
calls flb_plugin_alias_rewrite in flb_output.c) to check for the sentinel and
treat it as an error (fail cleanly) instead of falling back to the original
plugin_reference, and document the new return contract next to the
flb_plugin_alias_rewrite and flb_plugin_alias_get declarations.

In `@src/flb_network.c`:
- Around line 178-184: In flb_net_host_set make scheme detection strict: do not
use strstr(address, "://") which can match "://" anywhere; instead find the
first ':' with strchr(address, ':'), verify it is not at address (non-empty
scheme) and that the following two chars are '/' and '/' (i.e. separator[1]=='/'
&& separator[2]=='/'), and only then set s = separator + 3; otherwise fall back
to s = address + len. Update the code around variables separator, address, and s
in flb_net_host_set accordingly so only a proper leading "scheme://" is
accepted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5c181e7c-7d06-484f-933f-359991ea075c

📥 Commits

Reviewing files that changed from the base of the PR and between 66ffbe4 and 4efcaf7.

📒 Files selected for processing (7)
  • include/fluent-bit/flb_plugin_alias.h
  • src/CMakeLists.txt
  • src/flb_network.c
  • src/flb_output.c
  • src/flb_plugin_alias.c
  • tests/internal/CMakeLists.txt
  • tests/internal/plugin_alias.c

Comment thread include/fluent-bit/flb_plugin_alias.h
Comment thread src/flb_network.c Outdated
@cosmo0920
Copy link
Copy Markdown
Contributor Author

Ah nice mate, can we do this for any plugin then and what do we need?

Currently, I implemented only for out_es plugin like:

struct flb_plugin_alias_entry {
    int plugin_type;
    const char *alias_name;
    const char *plugin_name;
};

/*
 * Table that maps user-facing aliases to plugin short names.
 *
 * Keep this table focused on backwards/forwards compatibility names where the
 * historical short name is still used internally by the plugin implementation.
 */
static struct flb_plugin_alias_entry plugin_aliases[] = {
    {
        FLB_PLUGIN_OUTPUT,
        "elasticsearch",
        "es"
    },
    {
        0,
        NULL,
        NULL
    }
};

Just interpreted as es to be elasticsearch on loading output plugins.

@patrick-stephens
Copy link
Copy Markdown
Contributor

Ah nice mate, can we do this for any plugin then and what do we need?

Currently, I implemented only for out_es plugin like:

struct flb_plugin_alias_entry {
    int plugin_type;
    const char *alias_name;
    const char *plugin_name;
};

/*
 * Table that maps user-facing aliases to plugin short names.
 *
 * Keep this table focused on backwards/forwards compatibility names where the
 * historical short name is still used internally by the plugin implementation.
 */
static struct flb_plugin_alias_entry plugin_aliases[] = {
    {
        FLB_PLUGIN_OUTPUT,
        "elasticsearch",
        "es"
    },
    {
        0,
        NULL,
        NULL
    }
};

Just interpreted as es to be elasticsearch on loading output plugins.

But ultimately as long as we provide the aliases struct we are ok to use for any plugin?

@cosmo0920
Copy link
Copy Markdown
Contributor Author

Ah nice mate, can we do this for any plugin then and what do we need?

Currently, I implemented only for out_es plugin like:

struct flb_plugin_alias_entry {
    int plugin_type;
    const char *alias_name;
    const char *plugin_name;
};

/*
 * Table that maps user-facing aliases to plugin short names.
 *
 * Keep this table focused on backwards/forwards compatibility names where the
 * historical short name is still used internally by the plugin implementation.
 */
static struct flb_plugin_alias_entry plugin_aliases[] = {
    {
        FLB_PLUGIN_OUTPUT,
        "elasticsearch",
        "es"
    },
    {
        0,
        NULL,
        NULL
    }
};

Just interpreted as es to be elasticsearch on loading output plugins.

But ultimately as long as we provide the aliases struct we are ok to use for any plugin?

On paper, we'll be able to provide any type of the plugins of aliases but in this implementation we only provide a mechanism of output plugin alias.

cosmo0920 added 10 commits May 7, 2026 19:39
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@cosmo0920 cosmo0920 force-pushed the comso0920-handle-plugin-aliases branch from b175d14 to ba60204 Compare May 7, 2026 10:40
@cosmo0920 cosmo0920 changed the title alias: output: network: handle plugin aliases alias: handle input, output, filter, and processor plugin aliases May 7, 2026
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rename output plugin name from 'es' to 'elasticsearch'

3 participants