GELF - retrieve record id

Hi,
Is there a way to retrieve the elasticsearch record ID after the log has been submitted via GELF?

$transport = new TcpTransport("127.0.0.1", 12201);
$publisher = new Publisher();
$publisher->addTransport($transport);
$message = new Message();
$message->setLevel(\Psr\Log\LogLevel::INFO)->setShortMessage($model->desc);
$publisher->publish($message);

Hello,

I’m not exactly sure what ID you looking for so I’ll give you a couple examples.

Message ID

Elasticsearch scroll command.

curl -X GET "localhost:9200/_search?scroll=1m&pretty" -H 'Content-Type: application/json' -d'
{
  "sort": [
    "_doc"
  ]
}
'

Results

To help you further, some more information about what you want or some examples would be appreciated.

Hope that helps

hi gsmith. thanks for the reply.

i’d like to retrieve the ID right after it has been submitted/published.

$publisher->publish($message);

i.e.

something like,

$getRecordID = $publisher->publish($message);
return $getRecordID;

Hello,

I’m unfamiliar with what your doing. I was wondering if you could enlighten me or demonstrate how your executing these commands for Elasticsearch.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.