Skip to content

Commit 6069668

Browse files
committed
update
Signed-off-by: daniel parriott <[email protected]>
1 parent 6aa45bb commit 6069668

File tree

117 files changed

+4933
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+4933
-167
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
===========
2+
custom logs
3+
===========
4+
5+
http
6+
^^^^
7+
8+
Using the custom api logs integration is tricky, and not recommended.
9+
Elastic recommends using the Common Expression Language (`cel`) version now, but I don't know that yet.
10+
11+
Get agent status
12+
################
13+
14+
Get the agent status using the `get agents <https://elastic.co/docs/api/doc/kibana/operation/operation-get-fleet-agents>`_ api.
15+
16+
Use something like the following to get the `unhealthy` or `offline` agents.
17+
18+
.. code-block:: console
19+
20+
https://kibana.k8s.wafflelab.online:5601/api/fleet/agents?perPage=100&showInactive=true&getStatusSummary=true&kuery=status:unhealthy%20or%20status:offline
21+
22+
Do api authorization by setting the `request transforms` to the following:
23+
24+
.. code-block:: console
25+
26+
- set:
27+
target: headers.Authorization
28+
value: "API KEY"
29+
- set:
30+
target: headers.kbn-xsrf
31+
value: true
32+
33+
The `kbn-xsrf` header is necessary to get around `xsrf` protections in kibana.
34+

_sources/elk/agent/integrations/index.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Contents:
1010

1111
alienvault-otx
1212
cel
13-
13+
custom-logs

_sources/elk/beats/filebeat/notes.rst.txt

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Filebeat
44
========
55

6-
Added fields:
7-
^^^^^^^^^^^^^
6+
added fields
7+
^^^^^^^^^^^^
88

99
Filebeat appears to add some fields:
1010

@@ -14,3 +14,26 @@ Filebeat appears to add some fields:
1414

1515
There may be more, but these are what I have so far.
1616

17+
filestream input
18+
^^^^^^^^^^^^^^^^
19+
20+
The filestream input requires the files to be greater than 1024 bytes in size to be read.
21+
This can be a problem for testing.
22+
23+
Adjusting the `prospector` settings can make this easier, but `64` is the absolute minimum.
24+
I believe the `offset` starts the read at that offset, but I could be mistaken.
25+
I'm leaving it in because it's what I used and it worked for my uses.
26+
27+
.. code-block:: yaml
28+
29+
- type: filestream
30+
id: logs
31+
paths:
32+
- /var/log/test.log
33+
enabled: true
34+
prospector:
35+
scanner:
36+
fingerprint:
37+
length: 64
38+
offset: 0
39+

_sources/elk/eck.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ get the password
4545

4646
.. code-block:: console
4747
48-
$ kubectl get secret elasticsearch-wln-es-elastic-user -o go-template='{{.data.elastic | base64decode }}'
48+
$ kubectl get secret elasticsearch-es-elastic-user -o go-template='{{.data.elastic | base64decode }}'
4949
PASSWORD
5050
5151
links
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
Change the breaker limit
3+
^^^^^^^^^^^^^^^^^^^^^^^^
4+
5+
This is a temporary change, and probably a dumb one.
6+
7+
.. code-block:: console
8+
9+
curl -XPUT localhost:9200/_cluster/settings -d '{
10+
"transient" : {
11+
"indices.breaker.request.limit" : "41%"
12+
}
13+
}'
14+
15+
16+
get info about nodes in cluster
17+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
19+
sort by role, then disk usage
20+
21+
.. code-block:: console
22+
23+
GET _cat/nodes?v&h=name,role,master,shardStatsTotalCount,diskTotal,diskUsedPercent,cpu,load_1m,load_5m,load_15m,heapMax,heapCurrent,heapPercent&s=role,diskUsedPercent
24+
25+
get pipeline statistics for troubleshooting ingest processing times
26+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27+
28+
.. code-block:: console
29+
30+
GET _nodes/stats/ingest?filter_path=nodes.*.ingest
31+
32+
get number of indexing failures for all indices
33+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
35+
.. code-block:: console
36+
37+
GET _all/_stats/indexing?filter_path=indices.*.total.indexing.index_failed
38+
39+
show the current write thread pool statistics
40+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41+
42+
queue is particularly useful for diagnosing the overall write load on the cluster
43+
see: `cat-thread-pool <https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_
44+
45+
.. code-block:: console
46+
47+
GET _cat/thread_pool/write?v&h=node_name,name,active,size_queue,queue_size,rejected
48+
49+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
=============
2+
enrich policy
3+
=============
4+
5+
6+
enrichment policies can only have 1 match
7+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8+
9+
I guess we need to make sure there is only 1 field you want to match against.
10+
I could not find information about this in the documentation, but that is not a surprise.
11+
12+
race conditions
13+
^^^^^^^^^^^^^^^
14+
15+
If a new enrichment policy is put in place and executed, wait until it is finished before installing an ingest pipeline that uses it.
16+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
=============
3+
elasticsearch
4+
=============
5+
6+
Contents:
7+
8+
.. toctree::
9+
:maxdepth: 2
10+
11+
settings
12+
indices/index
13+
dev
14+
enrich_policy
15+
status
16+
templates
17+
shards
18+
tasks
19+
security/index
20+
ingest_pipelines
21+
interesting
22+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
Create an index on ES
3+
^^^^^^^^^^^^^^^^^^^^^
4+
5+
There are defaults for shards and replicas, so if those are okay, drop the `-d` and everything after it.
6+
7+
.. code-block:: console
8+
9+
curl -H'Content-Type: application/json' -XPUT 'localhost:9200/ossec?pretty'
10+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
============
2+
data streams
3+
============
4+
5+
6+
7+
decommission a data stream
8+
^^^^^^^^^^^^^^^^^^^^^^^^^^
9+
10+
.. warning::
11+
This doesn't actually do what we want.
12+
13+
If a data stream won't be used any longer but the old data needs
14+
to be kept, it can be modified using the `modify_data_stream` api
15+
to not have a write index anymore.
16+
This prevents an empty data stream from sitting around taking up space
17+
and valuable shards.
18+
19+
.. code-block:: console
20+
21+
POST /_data_stream/_modify
22+
{
23+
"actions": [
24+
{
25+
"remove_backing_index": {
26+
"data_stream": "logs-xxx-default",
27+
"index": ".ds-logs-xxx-default-000002"
28+
}
29+
}
30+
]
31+
}
32+
33+
Leave the ILM policy intact, so the old indices can continue through
34+
their stages of life.
35+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
======
2+
errors
3+
======
4+
5+
rollover target does not point to a write index
6+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
8+
Set one of the indices behind an alias to be the write index.
9+
10+
.. code-block:: console
11+
12+
POST _aliases
13+
{
14+
"actions": {
15+
"index": "index_name-000001",
16+
"alias": "index_alias",
17+
"is_write_index": true
18+
}
19+
}
20+
21+
22+
23+
restore from snapshot
24+
^^^^^^^^^^^^^^^^^^^^^
25+
26+
https://elastic.co/guide/en/elasticsearch/reference/current/restore-from-snapshot.html
27+

0 commit comments

Comments
 (0)