vectordotdev / vectordotdev/vector
Map `source` field in `splunk_hec` sink
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.6k
- Forks
- 2.3k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 146
Description
#2147 originally attempted to introduce a new source field across all of Vector's sources. This is a Splunk concept that attempts to abstract source information into a single field. This was intended to replace specific context keys within the source like file, container_name, topic_name, and so on. While I can see the value in this field, it starts to get awkward when we attempt to shoehorn multiple pieces of context into a single field. A better solution is to allow each source to set and define it's own context keys and then perform the source field mapping within the splunk_hec sink, where it is relevant. This is similar to how we map other fields in other sinks.
To provide a concrete list of mappings:
- When
source_typeisdockerset thesourcefield to{{ container_name }}:{{ container_id }}(open to feedback here). - When
source_typeisfileset thesourcefield to{{ file }}. - When
source_typeishttpset thesourcefield to{{ address }}. Blocked by #2269. - When
source_typeisjournaldset thesourcefield to{{_SYSTEMD_UNIT }}. - When
source_typeiskafkaset thesourcefield to{{ topic }}:{{ partition }}. Blocked by #1150. - When
source_typeislogplexset thesourcefield to{{ address }}. Blocked by #2271. - When
source_typeissocketset thesourcefield to{{ protocol }}:{{ address | peer_path }}. Blocked by #2270. - When
source_typeissplunk_hecset thesourcefield to{{ address }}. Blocked by #2273. - When
source_typeisstdinset thesourcefield tostdin. - When
source_typeissyslogset thesourcefield to{{ protocol }}:{{ address | peer_path }}. Blocked by #2272. - When
source_typeisvectorset thesourcefield to{{ address }}.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the splunk_hec sink and review the source-type mapping checklist in this issue. Implement the unblocked mappings, account for the issues marked as blockers, and consider the work done when the relevant events receive the specified Splunk source value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100