Hi everyone,
I want to set graylog retention to keep log in 1 week, so I set indices like the image below, but it sill only keep 1 days
When I try to reach a oldest log, Graylog show:
Could not execute search
There was an error executing your search. Please check your Graylog server logs for more information.
Error Message:
Unable to fulfill search request: cannot GET http://192.168.70.89:9000/api/search/universal/relative?query=gl2_source_input%3A5955e9b96454d00c2889491c&range=28800&limit=150&offset=10350&sort=timestamp%3Adesc (500)
Search status code:
500
I follow the instruction from the link logging - Graylog2- how to config logs retention to 1 week - Stack Overflow , please advise me how to fix the issue.
jochen
(Jochen)
July 28, 2017, 8:08am
2
Why donât you set the rotation period to 1 week (P1W
) if you want to keep logs for 1 week?
For me, 15 indices sounds good; you always have at most 12 hours extra.
The error message sounds weird. What does the list of indices in the default index set look like? Did you already try to recalculate index ranges?
I tried to set 1 week, even in retention strategey, I tried to set âDo nothingâ, but log file still be keep in only 1 day.
Here is my default index set. I tried to recalculate index range. In log file there is a warning:
2017-07-31T09:26:32.499+07:00 WARN [SearchResource] Unable to execute search: all shards failed
Another thing, why anytime I changed elasticsearch_max_time_per_index in server.conf, in Default index set not changes?
Please click tha blue âDefault index setâ text. This screen does not show the indices, but the index sets.
I think the error messages tell about something other than retention settings. Is your Elasticsearch cluster green? Any errors in the Elasticsearch log?
This issue: https://github.com/Graylog2/graylog2-server/issues/2917 has similar symptom; one possibility is that there is not enough memory on the Elasticsearch node, or the parameter max_result_window. Also this issue has the same message: https://github.com/Graylog2/graylog2-server/issues/3571
1 Like
the ES cluster is green with no error.
root@log-center:/etc/elasticsearch# curl -XGET âhttp://localhost:9200/_cluster/health?pretty=true â
{
âcluster_nameâ : âgraylogâ,
âstatusâ : âgreenâ,
âtimed_outâ : false,
ânumber_of_nodesâ : 2,
ânumber_of_data_nodesâ : 1,
âactive_primary_shardsâ : 44,
âactive_shardsâ : 44,
ârelocating_shardsâ : 0,
âinitializing_shardsâ : 0,
âunassigned_shardsâ : 0,
âdelayed_unassigned_shardsâ : 0,
ânumber_of_pending_tasksâ : 0,
ânumber_of_in_flight_fetchâ : 0,
âtask_max_waiting_in_queue_millisâ : 0,
âactive_shards_percent_as_numberâ : 100.0
}
root@log-center:/etc/elasticsearch# curl -X get http://localhost:9200/_cat/indices
green open graylog_9 4 0 50882127 0 15.2gb 15.2gb
green open graylog_8 4 0 6386896 0 1.8gb 1.8gb
green open graylog_7 4 0 16745766 0 5gb 5gb
green open graylog_6 4 0 6332252 0 1.8gb 1.8gb
green open graylog_1 4 0 48887836 0 14.6gb 14.6gb
green open graylog_0 4 0 1948195 0 821.3mb 821.3mb
green open graylog_10 4 0 814210 0 267mb 267mb
green open graylog_5 4 0 17187699 0 5.1gb 5.1gb
green open graylog_4 4 0 6567495 0 1.9gb 1.9gb
green open graylog_3 4 0 8971211 0 2.6gb 2.6gb
green open graylog_2 4 0 30630332 0 9.2gb 9.2gb
base on your link, I increase all index to 50000
curl -XPUT âhttp:// localhost:9200/graylog_10/_settingsâ -d â{ âindexâ : { âmax_result_windowâ : 50000} }â
curl -XPUT âhttp:// localhost:9200/graylog_9/_settingsâ -d â{ âindexâ : { âmax_result_windowâ : 50000} }â
curl -XPUT âhttp:// localhost:9200/graylog_8/_settingsâ -d â{ âindexâ : { âmax_result_windowâ : 50000} }â
âŠ
after did it, I can go past more than 66 page in search results, but it still only 1 day log, I have some graylog input which no much log, you can see in picture below, I go to last page with only log in current day.
hi,
you can switch from relative to absolute time in your search screen and try to query just events more than 24h ago. To me it looks like the index graylog_9 contains older messages than one day. See http://docs.graylog.org/en/2.3/pages/queries.html#time-frame-selector
1 Like
awesome, my bad, I leave the search bar default, so it only show in the last 8 hours. After I set relative time as you suggest, I can see log from another days. Thanks for your kind support, I appreciate it.
system
(system)
Closed
August 14, 2017, 10:20am
10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.