-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 functionality to the modify filter to move fields to the start or end #6103
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seveas
requested review from
edsiper,
leonardo-albertovich,
fujimotos and
koleini
as code owners
September 26, 2022 18:02
Example configuration, logfile input and debug log: [INPUT]
name tail
read_from_head true
path random.log
parser logfmt
exit_on_eof true
[FILTER]
name modify
match *
move_to_start splunk_
move_to_end backtrace XsI2p=/YTi8OBmUY splunk_index=exceptions fBUwQ=qsu68ms3VV backtrace="Back trace here" P+aQn=Hlh4+4XGVR M2cPv=LHrTQcBrhQ Zv9Ii=RRQF+ovKxF
backtrace="Back trace here" zxdbL=ujMjUm0DtR nHHnQ=WQw5bQdrrX splunk_index=exceptions 2geJD=8ni4bADWio sq/tR=MMFV6b0Wi6 r2RkK=odGYgfaVxz
splunk_index=exceptions dVK8C=7KCIUKxu0u 8P9GF=ust/rfkqKc KBSUr=QsAwe0qVBS SrpVi=9DDVS7YYUd backtrace="Back trace here" pw6e1=ihl4hDxNnl
m93CB=Rb2XpoNoZy Bh2Nf=nZn54wqRUq xh1YH=xTyL+KyId7 DqdsL=DjeYdll9nN splunk_index=exceptions backtrace="Back trace here" zhbRP=EFvKPtorhm
splunk_index=exceptions KRMLo=NhuhCNgoBy X0WYQ=v4WAmgYGw8 backtrace="Back trace here" rXHMG=PmNo0fxIlY fRX0P=J7FQ5Zaru6 thCJH=feuf+2sGRT
PyBFy=thSoPXnOhx IGirj=DEzW+jfWxM kUKRZ=UxBAOSbjy3 s//aT=25C/b0vOOr splunk_index=exceptions backtrace="Back trace here" 4JWgr=gd0pHy9cot
5jviw=DXPZLaEcps splunk_index=exceptions backtrace="Back trace here" BmcIR=AKdCWXEIky ZyCFJ=qAbDAd53/3 auOMg=WGZUBeqfCj OLl3s=Z1rJut6w9z
splunk_index=exceptions ieD/u=mOLfubIVac backtrace="Back trace here" bvdhB=YPSzQQO7r6 riMD6=9HkSCeyWdJ ilhca=VS0VeDb3HK lqhHb=flEP97ubLm
hrzdc=OSOaZcvuCB MzlD5=jaBhcZwwvR n2d2s=yaFfWm7vj1 MLy3t=tmgKomT362 VyjBc=m3O2yIwuBx splunk_index=exceptions backtrace="Back trace here"
9Mtma=FLuVDRbcoC backtrace="Back trace here" hVzqY=UfChGRo3D4 Wo7Sv=iD0LeEQdyU lg08P=8Hslz6j6UY JmQkc=ynx+F5W34v splunk_index=exceptions
backtrace="Back trace here" OKbSL=p3jIjqH5Kw +G00j=YU1uJgTVtG splunk_index=exceptions Jht8y=+Vv9XoDOMn Ear2n=wyEONNPGNE JIdhp=WfnF6ksJBz
d72fL=FkBgOTq9YX 4IiVR=PalJYDgre4 eyIPN=gFnMUZuZQ2 ucEam=GWW0sm3EF5 backtrace="Back trace here" ctdpz=XCqEw75Vvm splunk_index=exceptions
4NmHg=gUSHcd301d H/W/s=yz88/SkJqd 4/m1Y=/vNzmne10y l7XJf=v6+wrOwmSf splunk_index=exceptions backtrace="Back trace here" 7wlvw=l1VOUgeE0g
splunk_index=exceptions backtrace="Back trace here" k/f/g=CNWC7BainY K9x9E=F6KmL/c9s7 zMLVX=uvjjFjl9jc lMlkj=415e+glN1t 2cYb9=iTUzWPThBK
NMIQj=WkwYwV7tZ1 splunk_index=exceptions wdiVJ=wBVAoKa+Xd BS5zK=ijnvv8H8jU Sg/AO=oWc7txKZDS backtrace="Back trace here" POPQi=WTMyUiDHBi
Rw688=64L8ms153a nAUa4=cIdMgp4qJN YYZlS=pk0SdRW8Rh splunk_index=exceptions UQYDv=q44KRFnL4r backtrace="Back trace here" OmswD=8jPBGqaEvY
Cvc7W=xyX8xKL6WP O8jDh=yiQbqCpUex UTAw7=rzo7qbWtpz splunk_index=exceptions backtrace="Back trace here" 593iN=IQh5Mg5MOW weETh=9sjMb7AJsi
dul1G=Er34iROdwI tYwHQ=tsYmAKsnHS backtrace="Back trace here" gwahk=xcOPtSb8P9 splunk_index=exceptions fyz0C=jV7YvioZ15 ZGCli=VWSHJwdmou
lR/61=74J/60aWDU xZBZd=9m05PdS84y 5+sbu=oakOsMwmhy +O71+=CUWPpW5Ctl backtrace="Back trace here" miESW=7KdDEkh7vD splunk_index=exceptions
1hc21=o3DUqfgxHk splunk_index=exceptions A9taj=JAu+yPFlmH dF4IF=+74LkysATt backtrace="Back trace here" a7fTB=GNsvcVEv45 i/KFA=6WZm7K0fSF
|
… end In logging pipelines where downstream log receivers only inspect part of the message for efficiency reasons, it is useful to have known-importnat field at the start of the message and/or known-large fields at the end. This lets a user do so. Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
thanks. notes:
|
seveas
added a commit
to seveas/fluent-bit-docs
that referenced
this pull request
Oct 21, 2022
These were added in fluent/fluent-bit#6103 Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
lecaros
pushed a commit
to fluent/fluent-bit-docs
that referenced
this pull request
Oct 21, 2022
These were added in fluent/fluent-bit#6103 Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net> Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
mgeriesa
pushed a commit
to mgeriesa/fluent-bit
that referenced
this pull request
Oct 25, 2022
…to the start or end (fluent#6103) In logging pipelines where downstream log receivers only inspect part of the message for efficiency reasons, it is useful to have known-importnat field at the start of the message and/or known-large fields at the end. This lets a user do so. Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net> Signed-off-by: Manal Geries <mgeriesa@gmail.com>
sumitd2
pushed a commit
to sumitd2/fluent-bit
that referenced
this pull request
Feb 8, 2023
…to the start or end (fluent#6103) In logging pipelines where downstream log receivers only inspect part of the message for efficiency reasons, it is useful to have known-importnat field at the start of the message and/or known-large fields at the end. This lets a user do so. Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net> Signed-off-by: root <root@sumit-acs.novalocal>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In logging pipelines where downstream log receivers only inspect part of the message for efficiency reasons, it is useful to have known-importnat field at the start of the message and/or known-large fields at the end. This lets a user do so.
The specific use case for which I wrote this is sending exceptions with giant backtraces via fluent-bit to kafka and then splunk. Our splunk ingestor inspects the message to find a splunk_index field to determine which index to route to. For efficiency reasons, it only inspects the first few hundred bytes. This patch lets me always move the splunk_index field to the front and the backtrace to the back, making it possible for splunk to do the right thing.
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:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
Documentation
Backporting
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.