]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
5 weeks agopacketpool: improve thread safety 13518/head
Victor Julien [Sat, 21 Jun 2025 14:10:47 +0000 (16:10 +0200)] 
packetpool: improve thread safety

 lock_acquire: Calling pthread_mutex_lock acquires lock PktPoolLockedStack_.mutex.
 87        SCMutexLock(&my_pool->return_stack.mutex);

CID 1554228: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock PktPoolLockedStack_.mutex. This can cause a deadlock if the notification happens before the lock is acquired.
      Acquire the lock, then check the wait condition in a loop, without releasing with the lock before the wait. This will prevent deadlocks and failed conditions from spurious wakeups.

5 weeks agodetect/loader: add threading coverity warning
Victor Julien [Sat, 21 Jun 2025 10:42:17 +0000 (12:42 +0200)] 
detect/loader: add threading coverity warning

 lock_acquire: Calling pthread_mutex_lock acquires lock ThreadVars_.ctrl_mutex.
725        SCCtrlMutexLock(th_v->ctrl_mutex);

CID 1554214: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock ThreadVars_.ctrl_mutex. This can cause a deadlock if the notification happens before the lock is acquired.
      Acquire the lock, then check the wait condition in a loop, without releasing with the lock before the wait. This will prevent deadlocks and failed conditions from spurious wakeups.

5 weeks agoflow/manager: fix threading/locking coverity warnings
Victor Julien [Thu, 19 Jun 2025 12:24:18 +0000 (14:24 +0200)] 
flow/manager: fix threading/locking coverity warnings

In flow manager and recycler timed condition wait loops.

First check loop break conditions before entiring the timed wait.

CID 1638284: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock flow_manager_ctrl_mutex. This can cause a deadlock if the notification happens before the lock is acquired.

CID 1638293: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock flow_recycler_ctrl_mutex. This can cause a deadlock if the notification happens before the lock is acquired.

5 weeks agodefrag: improve thread safety in config logging
Victor Julien [Thu, 19 Jun 2025 10:52:32 +0000 (12:52 +0200)] 
defrag: improve thread safety in config logging

CID 1554235: (#1 of 1): Data race condition (MISSING_LOCK)
missing_lock: Accessing defragtracker_spare_q.len without holding lock DefragTrackerStack_.m. Elsewhere, DefragTrackerStack_.len is written to with DefragTrackerStack_.m held 2 out of 2 times.

5 weeks agodatasets: use locking wrappers everywhere
Victor Julien [Thu, 19 Jun 2025 10:33:16 +0000 (12:33 +0200)] 
datasets: use locking wrappers everywhere

To assist coverity, which got confused:

CID 1649393: (#1 of 1): Data race condition (MISSING_LOCK)
missing_lock: Accessing sets without holding lock sets_lock. Elsewhere, sets is written to with sets_lock held 2 out of 3 times.

5 weeks agoeve/schema: map mdns properties that have keywords
Jason Ish [Fri, 20 Jun 2025 18:07:11 +0000 (12:07 -0600)] 
eve/schema: map mdns properties that have keywords

Also add descriptions for the EVE index.

5 weeks agorules: add mdns rules
Jason Ish [Fri, 20 Jun 2025 18:17:12 +0000 (12:17 -0600)] 
rules: add mdns rules

5 weeks ago.gitignore: don't ignore rule files in rules/
Jason Ish [Fri, 20 Jun 2025 18:16:36 +0000 (12:16 -0600)] 
.gitignore: don't ignore rule files in rules/

These are rules we want to track edits to, as well as new and removed
files.

5 weeks agodoc/install: use our recommended header order
Jason Ish [Fri, 20 Jun 2025 15:12:17 +0000 (09:12 -0600)] 
doc/install: use our recommended header order

5 weeks agodoc/userguide: remove example with CentOS 7
Jason Ish [Wed, 18 Jun 2025 17:19:06 +0000 (11:19 -0600)] 
doc/userguide: remove example with CentOS 7

CentOS 7 is EOL.

Ticket: #7749

5 weeks agodoc/userguide: break out package installation
Jason Ish [Wed, 18 Jun 2025 17:16:02 +0000 (11:16 -0600)] 
doc/userguide: break out package installation

Break out RPM, Debian, and Ubuntu package installation into their own
pages.

Also break out other distributions like "Arch" into an "Other" section
with a note about how those packages are not supported by the OISF.

Ticket: #6252
Ticket: #6069

5 weeks agodoc/userguide: add appendix item on eve schema
Jason Ish [Thu, 19 Jun 2025 22:00:40 +0000 (16:00 -0600)] 
doc/userguide: add appendix item on eve schema

Add some basic documentation on our EVE schema, mainly to show users
that it exists.

5 weeks agolua: don't accept a table as a return value from match
Jason Ish [Thu, 19 Jun 2025 17:57:41 +0000 (11:57 -0600)] 
lua: don't accept a table as a return value from match

Remove the half finished support for accepting a table returned from a
Lua rule's match function. This is not documented, not tested, and not
really implemented.

Also, use lua_tointeger to get the return value from the match function
as an integer instead of a float.

Ticket: #6941

5 weeks agodetect/entropy: Clarify when entropy is logged
Jeff Lucovsky [Wed, 18 Jun 2025 13:14:16 +0000 (09:14 -0400)] 
detect/entropy: Clarify when entropy is logged

Clarify when entropy values are logged and associated with non-alert log
records.

5 weeks agodecode: add stats counters for ipv4/ipv6 over ipv4
Juliana Fajardini [Wed, 11 Jun 2025 21:29:58 +0000 (18:29 -0300)] 
decode: add stats counters for ipv4/ipv6 over ipv4

These existed for ipv6 over ipv6, and ipv4 over ipv6, but not for the
ipv4 counterpart.

Task #7758

5 weeks agodecode/ipv6: set packet flow in ip-in-ip
Juliana Fajardini [Wed, 11 Jun 2025 20:54:22 +0000 (17:54 -0300)] 
decode/ipv6: set packet flow in ip-in-ip

Bug #7752

5 weeks agodetect/analyzer: Extend analyzer output with dsize value info
Jeff Lucovsky [Sun, 15 Jun 2025 15:06:58 +0000 (11:06 -0400)] 
detect/analyzer: Extend analyzer output with dsize value info

Issue: 6357

6 weeks agodatasets: remove useless NULL check 13483/head
Eric Leblond [Mon, 16 Jun 2025 09:23:43 +0000 (11:23 +0200)] 
datasets: remove useless NULL check

Coverity did detect that the cleaning code is only reached with
Dataset *set being initialized so the check is useless.

** CID 1649392:       Null pointer dereferences  (REVERSE_INULL)
/src/datasets-context-json.c: 719           in DatajsonGet()
>>>     Null-checking "set" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.

** CID 1649391:       Null pointer dereferences  (REVERSE_INULL)
/src/datasets.c: 526           in DatasetGet()
>>>     Null-checking "set" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.

6 weeks agodatasets: remove unreachable code
Eric Leblond [Thu, 12 Jun 2025 09:16:16 +0000 (11:16 +0200)] 
datasets: remove unreachable code

As the DatasetGetOrCreate function is called before the creation
of the hash, it will never be available so we can remove the
cleaning.

6 weeks agoutil/mpm: grow state queue on demand
Philippe Antoine [Tue, 17 Jun 2025 13:06:27 +0000 (15:06 +0200)] 
util/mpm: grow state queue on demand

Ticket: 7678

6 weeks agoutil/mpm: factorize code
Philippe Antoine [Tue, 17 Jun 2025 13:06:08 +0000 (15:06 +0200)] 
util/mpm: factorize code

6 weeks agompm: allocate StateQueue on the heap for ks
Philippe Antoine [Tue, 17 Jun 2025 08:35:55 +0000 (10:35 +0200)] 
mpm: allocate StateQueue on the heap for ks

Completes commit 92fce2fdc069324e6060ce046ca80da6a351573c

Ticket: 6264

6 weeks agodoc/install: windows build documentation
Jason Ish [Mon, 16 Jun 2025 18:26:39 +0000 (12:26 -0600)] 
doc/install: windows build documentation

Ticket: #5911

6 weeks agoconfigure: display if we have npcap support
Jason Ish [Mon, 16 Jun 2025 18:28:10 +0000 (12:28 -0600)] 
configure: display if we have npcap support

6 weeks agorust: fix prototype for AppLayerParserTriggerRawStreamInspection
Philippe Antoine [Tue, 17 Jun 2025 09:37:15 +0000 (11:37 +0200)] 
rust: fix prototype for AppLayerParserTriggerRawStreamInspection

Ticket: 7762

As it modifies the flow indeed

6 weeks agorust: remove unnecessary cbindgen exclusions
Philippe Antoine [Tue, 17 Jun 2025 09:26:04 +0000 (11:26 +0200)] 
rust: remove unnecessary cbindgen exclusions

6 weeks agoutil/mpm: constify arg
Philippe Antoine [Tue, 17 Jun 2025 09:18:47 +0000 (11:18 +0200)] 
util/mpm: constify arg

and make rust version use the correct integer type

Ticket: 7762

6 weeks agoutil/mtu: Avoid excessive ioctls for MTU
Jeff Lucovsky [Mon, 16 Jun 2025 14:04:48 +0000 (10:04 -0400)] 
util/mtu: Avoid excessive ioctls for MTU

Issue: 7643

Use the cached livedev MTU value, when available.

6 weeks agopcap-log: fix memory leak on error paths after SCStrdup(prefix)
Boris Tonofa [Sat, 14 Jun 2025 08:44:57 +0000 (11:44 +0300)] 
pcap-log: fix memory leak on error paths after SCStrdup(prefix)

When PcapLogDataCopy() fails after duplicating pl->prefix,
the allocated 'prefix' string was not freed, leading to a leak.

Ticket: 7759

6 weeks agowindows: use _tzname instead of tzname 13467/head
Jason Ish [Mon, 16 Jun 2025 22:34:36 +0000 (16:34 -0600)] 
windows: use _tzname instead of tzname

tzname is a POSIX variable, WIN32 has prefixed many POSIX variables
with "_". While Mingw64 supports both, UCRT64 emits a compiler warning
on the usage of "tzname".

This triggered a rather large clang-format update.

6 weeks agogithub-ci: add windows ucrt build
Jason Ish [Mon, 16 Jun 2025 21:18:19 +0000 (15:18 -0600)] 
github-ci: add windows ucrt build

MSYS2 now recommends the UCRT environment as the default, so we should
probably add a CI job for it.

6 weeks agodoc/code-style: add rust; minor cleanups
Jason Ish [Mon, 16 Jun 2025 21:09:37 +0000 (15:09 -0600)] 
doc/code-style: add rust; minor cleanups

- Add small section on Rust code, and Rust code exposed to FFI.
- Other minor cleanups.

Ticket: #7078
Ticket: #6955

6 weeks agodoc/userguide/code-style: update header ordering
Jason Ish [Mon, 16 Jun 2025 20:26:16 +0000 (14:26 -0600)] 
doc/userguide/code-style: update header ordering

To match our recommended header ordering.

6 weeks agoversion: start development towards 8.0.0 13454/head
Shivani Bhardwaj [Mon, 16 Jun 2025 05:21:50 +0000 (10:51 +0530)] 
version: start development towards 8.0.0

6 weeks agorelease: 8.0.0-rc1; update changelog suricata-8.0.0-rc1
Shivani Bhardwaj [Thu, 12 Jun 2025 14:47:08 +0000 (20:17 +0530)] 
release: 8.0.0-rc1; update changelog

6 weeks agodetect/dataset: skip adding localstatedir if fullpath is provided 13437/head
Andreas Herz [Wed, 11 Jun 2025 08:47:45 +0000 (10:47 +0200)] 
detect/dataset: skip adding localstatedir if fullpath is provided

When the option to set a full path is enabled and a full path is
provided, skip adding the prefix (based on localstatedir) to the
directory since it would be unexpected and unwanted by a user.

Ticket: 7083

6 weeks agodatajson: limit impact of feature for non user
Eric Leblond [Wed, 11 Jun 2025 12:02:19 +0000 (14:02 +0200)] 
datajson: limit impact of feature for non user

The det_ctx structure was inflated by the additoin of the array to
handle JSON context. This commit updates the code to use a growing
buffer and limit the impact.

6 weeks agodetect/alert: optimize context cleanup
Victor Julien [Wed, 11 Jun 2025 20:15:24 +0000 (22:15 +0200)] 
detect/alert: optimize context cleanup

Don't always loop over each alert, but only do so if context was used.

6 weeks agolua: update to lua 5.4.8002
Jason Ish [Wed, 11 Jun 2025 20:38:33 +0000 (14:38 -0600)] 
lua: update to lua 5.4.8002

This updated crates remove tmpnam from being linked in, removing the
warning.

7 weeks agopacket: micro optimization in packet recycling 13432/head
Victor Julien [Wed, 11 Jun 2025 17:10:41 +0000 (19:10 +0200)] 
packet: micro optimization in packet recycling

7 weeks agodetect: move large array to bottom of detect thread ctx
Victor Julien [Wed, 11 Jun 2025 17:09:53 +0000 (19:09 +0200)] 
detect: move large array to bottom of detect thread ctx

7 weeks agodetect/pcre: add needed casts
Eric Leblond [Wed, 11 Jun 2025 13:34:06 +0000 (15:34 +0200)] 
detect/pcre: add needed casts

7 weeks agodatajson: add needed cast
Eric Leblond [Wed, 11 Jun 2025 12:52:22 +0000 (14:52 +0200)] 
datajson: add needed cast

7 weeks agodatajson: fix include in header
Eric Leblond [Wed, 11 Jun 2025 07:34:03 +0000 (09:34 +0200)] 
datajson: fix include in header

7 weeks agodetect: remove some useless tests
Eric Leblond [Tue, 10 Jun 2025 18:34:38 +0000 (20:34 +0200)] 
detect: remove some useless tests

7 weeks agodoc/userguide: fix some typos
Eric Leblond [Tue, 10 Jun 2025 18:07:45 +0000 (20:07 +0200)] 
doc/userguide: fix some typos

7 weeks agopacket: optimize json context cleaning
Eric Leblond [Tue, 10 Jun 2025 09:43:12 +0000 (11:43 +0200)] 
packet: optimize json context cleaning

We don't need to recycle the full alert array. This is going to
optimize packet recycle time.

7 weeks agodecode: light refactor on packet cleaning
Eric Leblond [Tue, 10 Jun 2025 09:42:12 +0000 (11:42 +0200)] 
decode: light refactor on packet cleaning

7 weeks agodatasets: improve lock handling
Eric Leblond [Mon, 9 Jun 2025 09:45:03 +0000 (11:45 +0200)] 
datasets: improve lock handling

DatasetGetOrCreate should now be called with the dataset lock
hold so the lock management is easier to read.

7 weeks agodetect/dataset: fix locking on datajson
Eric Leblond [Mon, 9 Jun 2025 09:38:22 +0000 (11:38 +0200)] 
detect/dataset: fix locking on datajson

7 weeks agodetect/dataset: check context_key validity
Eric Leblond [Mon, 9 Jun 2025 09:30:26 +0000 (11:30 +0200)] 
detect/dataset: check context_key validity

As context_key is an user entry and as it is used to build the JSON
string of alert, we could end up with an invalid event if the string
contains improper characters.

7 weeks agoeve/alert: add comment about string format
Eric Leblond [Mon, 9 Jun 2025 09:17:25 +0000 (11:17 +0200)] 
eve/alert: add comment about string format

7 weeks agodetect/pcre: fix error handling
Eric Leblond [Mon, 9 Jun 2025 09:14:37 +0000 (11:14 +0200)] 
detect/pcre: fix error handling

7 weeks agodetect/engine: put datajson related code in a func
Eric Leblond [Mon, 9 Jun 2025 09:10:20 +0000 (11:10 +0200)] 
detect/engine: put datajson related code in a func

7 weeks agodatasets: use SCLogError for errors
Eric Leblond [Mon, 9 Jun 2025 08:50:19 +0000 (10:50 +0200)] 
datasets: use SCLogError for errors

7 weeks agodetect/engine: remove unused keyword
Eric Leblond [Mon, 9 Jun 2025 08:35:02 +0000 (10:35 +0200)] 
detect/engine: remove unused keyword

7 weeks agodatasets: comment to specify usage of field
Eric Leblond [Mon, 9 Jun 2025 08:34:31 +0000 (10:34 +0200)] 
datasets: comment to specify usage of field

7 weeks agodecode: use pointer for PacketContextData
Eric Leblond [Mon, 9 Jun 2025 08:27:16 +0000 (10:27 +0200)] 
decode: use pointer for PacketContextData

By adding a pointer instead of the structure in the alert info
we spare some memory.

7 weeks agodecode: rename ExtraDataJsonList
Eric Leblond [Mon, 9 Jun 2025 08:14:27 +0000 (10:14 +0200)] 
decode: rename ExtraDataJsonList

7 weeks agodatasets: comments about format
Eric Leblond [Mon, 9 Jun 2025 08:09:34 +0000 (10:09 +0200)] 
datasets: comments about format

7 weeks agodatasets: rename function
Eric Leblond [Mon, 9 Jun 2025 08:07:04 +0000 (10:07 +0200)] 
datasets: rename function

DatasetCreateOrGet was in fact doing get or create.

7 weeks agodatasets: fix error handling in StringSet
Eric Leblond [Mon, 9 Jun 2025 08:04:35 +0000 (10:04 +0200)] 
datasets: fix error handling in StringSet

7 weeks agodatasets: factorize set operation
Eric Leblond [Mon, 9 Jun 2025 07:59:17 +0000 (09:59 +0200)] 
datasets: factorize set operation

7 weeks agodatasjson: fix include barrier name
Eric Leblond [Mon, 9 Jun 2025 07:52:13 +0000 (09:52 +0200)] 
datasjson: fix include barrier name

7 weeks agodetect/pcre: fix copyright date
Eric Leblond [Mon, 9 Jun 2025 07:50:18 +0000 (09:50 +0200)] 
detect/pcre: fix copyright date

7 weeks agodatajson: key length fix
Eric Leblond [Sun, 8 Jun 2025 08:17:50 +0000 (10:17 +0200)] 
datajson: key length fix

When using type string, we should not limit the size of the string.

This patch also fixes some implicit cast issues.

7 weeks agodatajson: value_key is necessary in json format
Eric Leblond [Sun, 8 Jun 2025 07:28:58 +0000 (09:28 +0200)] 
datajson: value_key is necessary in json format

7 weeks agodoc/userguide: enrichment_key is now context_key
Eric Leblond [Sun, 8 Jun 2025 07:05:13 +0000 (09:05 +0200)] 
doc/userguide: enrichment_key is now context_key

7 weeks agodatajson: rename enrichment_key to context_key
Eric Leblond [Sun, 8 Jun 2025 07:03:04 +0000 (09:03 +0200)] 
datajson: rename enrichment_key to context_key

7 weeks agodatajson: factorize code
Eric Leblond [Sat, 7 Jun 2025 20:45:38 +0000 (22:45 +0200)] 
datajson: factorize code

Code was duplicated and a build error was reported so factorizing
was the best way to clean it.

7 weeks agodatajson: add sanity check on length
Eric Leblond [Sat, 7 Jun 2025 20:19:03 +0000 (22:19 +0200)] 
datajson: add sanity check on length

Also cast to avoid compilation error.

7 weeks agodatajson: use systematic allocation
Eric Leblond [Sat, 7 Jun 2025 19:34:50 +0000 (21:34 +0200)] 
datajson: use systematic allocation

7 weeks agodatajson: more explicit memory handling
Eric Leblond [Sat, 7 Jun 2025 17:24:48 +0000 (19:24 +0200)] 
datajson: more explicit memory handling

7 weeks agodoc/userguide: fix some typos
Eric Leblond [Fri, 6 Jun 2025 11:35:00 +0000 (13:35 +0200)] 
doc/userguide: fix some typos

Suggestions from Juliana.

Co-authored-by: Juliana Fajardini Reichow <jufajardini@gmail.com>
7 weeks agoeve/schema: fix ordering
Eric Leblond [Sun, 1 Jun 2025 20:24:12 +0000 (22:24 +0200)] 
eve/schema: fix ordering

7 weeks agodatasets: remove comment about unused return value
Eric Leblond [Thu, 29 May 2025 09:00:14 +0000 (11:00 +0200)] 
datasets: remove comment about unused return value

7 weeks agodatajson: simplify memory handling
Eric Leblond [Thu, 29 May 2025 08:31:02 +0000 (10:31 +0200)] 
datajson: simplify memory handling

DatajsonAdd function is now responsible of the handling of the mem
of datajsontype passed as argument.

7 weeks agodatajson: use wrapper
Eric Leblond [Tue, 27 May 2025 20:33:53 +0000 (22:33 +0200)] 
datajson: use wrapper

7 weeks agodatajson: fix potential leak in error handling
Eric Leblond [Tue, 27 May 2025 20:08:27 +0000 (22:08 +0200)] 
datajson: fix potential leak in error handling

7 weeks agodatajson: remove unnecessary abstraction
Eric Leblond [Tue, 27 May 2025 19:53:56 +0000 (21:53 +0200)] 
datajson: remove unnecessary abstraction

7 weeks agogithub: upload scan-build artifacts
Eric Leblond [Fri, 23 May 2025 18:49:54 +0000 (20:49 +0200)] 
github: upload scan-build artifacts

7 weeks agodatajson: use more broadly supported formatter
Eric Leblond [Sun, 18 May 2025 16:19:09 +0000 (18:19 +0200)] 
datajson: use more broadly supported formatter

7 weeks agodatajson: fix formatting
Eric Leblond [Wed, 7 May 2025 14:43:49 +0000 (16:43 +0200)] 
datajson: fix formatting

7 weeks agodatasets: factorize dataset creation
Eric Leblond [Fri, 2 May 2025 18:48:59 +0000 (20:48 +0200)] 
datasets: factorize dataset creation

Factorize DatasetGet and DatajsonGet to only have the difference
between the two in the respective function.

7 weeks agodatasets: separate DatasetGet in 2 functions
Eric Leblond [Fri, 2 May 2025 15:30:14 +0000 (17:30 +0200)] 
datasets: separate DatasetGet in 2 functions

This will be used to factorize the code with datajson.

7 weeks agodatasets/context: rename the datajson files
Eric Leblond [Fri, 2 May 2025 09:36:18 +0000 (11:36 +0200)] 
datasets/context: rename the datajson files

They are is renamed to datasets-context-json.* so we see that
it is about context and not about a new datasets type.

7 weeks agodoc/userguide: jsonline is now standard ndjson
Eric Leblond [Thu, 1 May 2025 07:05:31 +0000 (09:05 +0200)] 
doc/userguide: jsonline is now standard ndjson

7 weeks agodatajson: rename jsonline to ndjson
Eric Leblond [Thu, 1 May 2025 07:03:45 +0000 (09:03 +0200)] 
datajson: rename jsonline to ndjson

7 weeks agodoc/userguide: improve datajson doc
Eric Leblond [Tue, 29 Apr 2025 09:17:29 +0000 (11:17 +0200)] 
doc/userguide: improve datajson doc

7 weeks agodatajson: output context to "context"
Eric Leblond [Tue, 29 Apr 2025 08:51:23 +0000 (10:51 +0200)] 
datajson: output context to "context"

Using `alert.extra` was not really reflecting the nature of what
was added. So renaming it to `alert.context`.

7 weeks agodatajson: fix thread safety violation
Eric Leblond [Mon, 28 Apr 2025 19:29:51 +0000 (21:29 +0200)] 
datajson: fix thread safety violation

7 weeks agodatajson: reduce size length
Eric Leblond [Sun, 6 Apr 2025 09:12:39 +0000 (11:12 +0200)] 
datajson: reduce size length

7 weeks agodatajson: fix string format in error message
Eric Leblond [Sun, 6 Apr 2025 09:05:47 +0000 (11:05 +0200)] 
datajson: fix string format in error message

7 weeks agoeve/schema: remove reference to datajson
Eric Leblond [Sun, 6 Apr 2025 08:39:05 +0000 (10:39 +0200)] 
eve/schema: remove reference to datajson

7 weeks agodoc/userguide: remove left over datajson reference
Eric Leblond [Sun, 6 Apr 2025 08:35:59 +0000 (10:35 +0200)] 
doc/userguide: remove left over datajson reference

7 weeks agodoc/userguide: improve datajson doc
Eric Leblond [Sat, 29 Mar 2025 08:15:56 +0000 (09:15 +0100)] 
doc/userguide: improve datajson doc

Patch adds ``remove_key`` option and clarifies the text.

7 weeks agodatajson: add remove_key option to dataset
Eric Leblond [Sat, 29 Mar 2025 07:49:12 +0000 (08:49 +0100)] 
datajson: add remove_key option to dataset

This option allows to remove the key corresponding to the match
value from the JSON object before creating the JSON object that
will be added to the `extra` data.

For example, matching on the following JSON on the `ip` key:

```json
{"ip": "10.16.1.11", "test": "success", "context":3}
```

with a match like:

```
dataset:isset,src_ip,type ip,load src.lst,format jsonline,enrichment_key src_ip,value_key ip;
```

will produce the following:

```json
"extra": {
  "src_ip": {
    "ip": "10.16.1.11",
    "test": "success",
    "context": 3
  }
```

if we add the `remove_key` option to the match:

```
dataset:isset,src_ip,type ip,load src.lst,format jsonline,enrichment_key src_ip,value_key ip, remove_key;
```

it will produce the following:

```json
"extra": {
  "src_ip": {
    "test": "success",
    "context": 3
  }
```

The option is set to false by default.

Ticket: #7372

7 weeks agodoc/userguide: basic doc for jsonline format
Eric Leblond [Thu, 27 Mar 2025 22:29:42 +0000 (23:29 +0100)] 
doc/userguide: basic doc for jsonline format

7 weeks agodatajson: implement jsonline format
Eric Leblond [Thu, 27 Mar 2025 22:04:48 +0000 (23:04 +0100)] 
datajson: implement jsonline format

This format allows to use a one valid JSON object per line in the
data file.

Ticket: #7372

7 weeks agodatajson: prepare jsonline format
Eric Leblond [Thu, 27 Mar 2025 21:32:31 +0000 (22:32 +0100)] 
datajson: prepare jsonline format

There is just a change in the iterator to go from json to jsonline
so let's factorize the parsing functions.

Ticket: #7372