Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

"dot" in Elasticsearch Index fields #186

Description

@commitcode

In file phplib/Filter/Enricher.php, the following code will generate field names with "dot" in them and since Elastisearch doesn't support "dot" in fields names, alerts will not be saved on the server.

if(is_object($val)) { $val = json_encode($val); }

Something like this should work:

function flatten(array $array)
	{
	$return = array();
	array_walk_recursive($array,
	function ($a) use(&$return)
		{
		$return[] = $a;
		}
	});

if (is_array($val))
	{
	$flat_array = flatten($val)
	foreach($flat_array as $key_ => $value_)
		{
		$alert['content'][$key_] = $value_;
		}
	}
  else
	{
	$alert['content'][$key] = $val;
	}

ref:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions