Comments (14)
I suppose delimiters(string(":\n"))
could be one way to specify multichar delimiters, without breaking backwards compatibility, and still making sense.
from syslog-ng.
Looks sane to me yes
from syslog-ng.
What do you think about flags(string-delimiter)
? It wouldn't introduce an other member variable in LogCSVParser and the code would be more consistent.
from syslog-ng.
👍 for string-delimiter flag
from syslog-ng.
I'm not a great fan of flags, to be honest. It means I have to keep an eye on two settings, and makes it harder to write blocks or other kinds of DSL.
from syslog-ng.
A third option won: string-delimiters(":,", "//")
. You can use this and delimiters()
simultaneously, the former has the precedence.
I have a little ugly, but working version here: https://github.com/ihrwein/syslog-ng/tree/f/csv-string-delimeter
According to the test cases it does it's job, but I'm working on refactoring the whole code.
from syslog-ng.
Well, that has the same problem as the string-delimiter flag: making it harder to write anything on top of it. But since I won't be using the functionality, it doesn't matter for me. Just wanted to highlight that using a new option instead of the flag doesn't change much from a DSL point of view.
from syslog-ng.
@algernon: thank you for your notes (Having more opinions before implementing a feature is a good thing, IMHO. )
As I see your idea, the optimal solution would be if user could set delimiters as:
delimiters(chars(",;:"), string("xx"))
. But -as you already mentioned- we have to deal with backward compatibility. So backward compatibility breaks the optimal solution, in that situation, from my point of view, both solution is fine, but I would go with string-delimiters()
option :-) .
@faxm0dem: which solution do yo prefer? (our opinions -as developers- not as important as yours :-) )
a)
delimiters(":,", string("//"))
b)
delimiters(":,")
string-delimiters("//")
from syslog-ng.
both would work for me, whatever's easiest to implement/maintain
from syslog-ng.
Ok, we prefer solution b) .
Thanks!
from syslog-ng.
My optimal solution would be delimiters(",;:")
working as before, internally perhaps being an alternative to delimiters(chars(",;:"))
. And only delimiters(string(",;:"))
would be new.
The grammar rules for this aren't all that bad:
| KW_DELIMITERS '(' delimit-spec ')' { YYACCEPT; }
and then:
delimit-spec
: KW_CHARS '(' string ')' { ... }
| KW_STRING '(' string ')' { ... }
| string { /* same code as KW_CHARS case */ }
;
Voila. All syntax within delimiters()
, backward compatibility still preserved.
from syslog-ng.
@algernon: finally, your suggestion was chosen :-)
from syslog-ng.
@faxm0dem, could you check it too?
from syslog-ng.
The PR was merged, so this issue can be closed.
from syslog-ng.
Related Issues (20)
- Support role in s3 destination
- Sending logs to OpenSearch using panos parser produces JSON error in OpenSearch HOT 2
- default-network-drivers() is not getting fortigate logs hostname ($HOST) correctly HOT 4
- stats(healthcheck-freq()) problems HOT 4
- On a stressed system, some logs are not being written to the log file. HOT 2
- openobserve config is incorrect HOT 2
- Syslog-ng stops writing logs to a file from a custom systemd-journald namespace after a server restart HOT 2
- Support aws:kms encryption in the s3 destination
- [4.7.1] can't compile cloud-auth when using libressl HOT 2
- compile error in otel when ipv6 support is disabled
- clang c++ support HOT 1
- trusted-keys: support a secure hash algorithm HOT 1
- Add macro for certificate fingerprint HOT 1
- Unexpected behavior with multiple conditions including 'not' in the filter HOT 4
- There is no problem starting syslog-ng, but Verify reports an error. HOT 1
- OpenTelemetry/OTLP: add support for certificate pinning, like with `trusted-keys()` HOT 3
- Config failing with kafka and template HOT 3
- syslog-ng 3.24.1 sometimes crash in log_pipe_queue HOT 2
- libcloud-auth is underlinked HOT 1
- Fuzzing discovery HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from syslog-ng.