doc-exports/docs/css/umn/css_01_0146.html
Wuwan, Qi 050b395397 CSS UMN 23.2.1 20230926
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-committed-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
2024-01-10 14:23:15 +00:00

171 lines
15 KiB
HTML

<a name="css_01_0146"></a><a name="css_01_0146"></a>
<h1 class="topictitle1">Access Logs</h1>
<div id="body0000001272932417"><div class="section" id="css_01_0146__en-us_topic_0000001272932417_section104847386416"><h4 class="sectiontitle">Context</h4><p id="css_01_0146__en-us_topic_0000001272932417_p16618151523614">You can check access logs in either of the following ways:</p>
<ul id="css_01_0146__en-us_topic_0000001272932417_ul467133317363"><li id="css_01_0146__en-us_topic_0000001272932417_li1671333123612">Enable and check access logs via an independent API. Configure the API parameters to record the access log time and size. The access log content is returned through a REST API.</li><li id="css_01_0146__en-us_topic_0000001272932417_li1522934133618">Print access logs. Your access logs are printed as files in backend logs.</li></ul>
<p id="css_01_0146__en-us_topic_0000001272932417_p17762845133615">Enabling the access log function may affect cluster performance.</p>
<p id="css_01_0146__en-us_topic_0000001272932417_p1327218103711">The following table describes access log parameters.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0146__en-us_topic_0000001272932417_table14438151713712" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Access log parameters</caption><thead align="left"><tr id="css_01_0146__en-us_topic_0000001272932417_row134385172373"><th align="left" class="cellrowborder" valign="top" width="24.39%" id="mcps1.3.1.6.2.4.1.1"><p id="css_01_0146__en-us_topic_0000001272932417_p94387177375">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.379999999999999%" id="mcps1.3.1.6.2.4.1.2"><p id="css_01_0146__en-us_topic_0000001272932417_p35341047113710">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60.23%" id="mcps1.3.1.6.2.4.1.3"><p id="css_01_0146__en-us_topic_0000001272932417_p84381717153717">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_01_0146__en-us_topic_0000001272932417_row10438717163713"><td class="cellrowborder" valign="top" width="24.39%" headers="mcps1.3.1.6.2.4.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p17438317183719">duration_limit</p>
</td>
<td class="cellrowborder" valign="top" width="15.379999999999999%" headers="mcps1.3.1.6.2.4.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p145341647133719">String</p>
</td>
<td class="cellrowborder" valign="top" width="60.23%" headers="mcps1.3.1.6.2.4.1.3 "><p id="css_01_0146__en-us_topic_0000001272932417_p164381817183717">Duration recorded in an access log.</p>
<p id="css_01_0146__en-us_topic_0000001272932417_p154384172374">Value range: 10 to 120</p>
<p id="css_01_0146__en-us_topic_0000001272932417_p9438111793716">Unit: s</p>
<p id="css_01_0146__en-us_topic_0000001272932417_p0438417143712">Default value: <strong id="css_01_0146__en-us_topic_0000001272932417_b82077115131645">30</strong></p>
</td>
</tr>
<tr id="css_01_0146__en-us_topic_0000001272932417_row34381417173716"><td class="cellrowborder" valign="top" width="24.39%" headers="mcps1.3.1.6.2.4.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p18438201753718">capacity_limit</p>
</td>
<td class="cellrowborder" valign="top" width="15.379999999999999%" headers="mcps1.3.1.6.2.4.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p853404783711">String</p>
</td>
<td class="cellrowborder" valign="top" width="60.23%" headers="mcps1.3.1.6.2.4.1.3 "><p id="css_01_0146__en-us_topic_0000001272932417_p9438111753718">Size of an access log. After access logging is enabled, the size of recorded requests is checked. If the size exceeds the value of this parameter, the access logging stops.</p>
<p id="css_01_0146__en-us_topic_0000001272932417_p743820171376">Value range: 1 to 5</p>
<p id="css_01_0146__en-us_topic_0000001272932417_p4438161714372">Unit: MB</p>
<p id="css_01_0146__en-us_topic_0000001272932417_p1343871763718">Default value: <strong id="css_01_0146__en-us_topic_0000001272932417_b94354221883">1</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="css_01_0146__en-us_topic_0000001272932417_note047294821315"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="css_01_0146__en-us_topic_0000001272932417_p747117595384">Access logging stops if either <strong id="css_01_0146__en-us_topic_0000001272932417_b19740103912135">duration_limit</strong> or <strong id="css_01_0146__en-us_topic_0000001272932417_b163901442201312">capacity_limit</strong> reaches the threshold.</p>
</div></div>
</div>
<div class="section" id="css_01_0146__en-us_topic_0000001272932417_section444135103818"><h4 class="sectiontitle">Procedure</h4><ol id="css_01_0146__en-us_topic_0000001272932417_ol927111214106"><li id="css_01_0146__en-us_topic_0000001272932417_li1274916552817">Log in to the CSS management console.</li><li id="css_01_0146__en-us_topic_0000001272932417_li1274935516811">Choose <strong id="css_01_0146__en-us_topic_0000001272932417_b146264344517">Clusters</strong> in the navigation pane. On the <strong id="css_01_0146__en-us_topic_0000001272932417_b62301657155314">Clusters</strong> page, locate the target cluster and click <strong id="css_01_0146__en-us_topic_0000001272932417_b12236105745320">Access Kibana</strong> in the <strong id="css_01_0146__en-us_topic_0000001272932417_b8236657115313">Operation</strong> column.</li><li id="css_01_0146__en-us_topic_0000001272932417_li927171291011">In the navigation pane on the left, choose <strong id="css_01_0146__en-us_topic_0000001272932417_b13595204599">Dev Tools</strong> and run commands to enable or disable access logs.<ul id="css_01_0146__en-us_topic_0000001272932417_ul1124125195910"><li id="css_01_0146__en-us_topic_0000001272932417_li72410535913">Enabling access logs for all nodes in a cluster<pre class="screen" id="css_01_0146__en-us_topic_0000001272932417_screen14539553123916">PUT /_access_log?duration_limit=30s&amp;capacity_limit=1mb</pre>
</li><li id="css_01_0146__en-us_topic_0000001272932417_li5251565912">Enabling access logs for a node in a cluster<pre class="screen" id="css_01_0146__en-us_topic_0000001272932417_screen614712556390">PUT /_access_log/<em id="css_01_0146__en-us_topic_0000001272932417_i1255133114421">{nodeId}</em>?duration_limit=30s&amp;capacity_limit=1mb</pre>
<p id="css_01_0146__en-us_topic_0000001272932417_p20727723174210"><em id="css_01_0146__en-us_topic_0000001272932417_i1975333701514">{nodeId}</em> indicates the ID of the node where you want to enable access logs.</p>
</li></ul>
</li><li id="css_01_0146__en-us_topic_0000001272932417_li205431559164310">Use APIs to check access logs.<ul id="css_01_0146__en-us_topic_0000001272932417_ul5383184114410"><li id="css_01_0146__en-us_topic_0000001272932417_li1638384194411">API for checking the access logs of all nodes in a cluster<pre class="screen" id="css_01_0146__en-us_topic_0000001272932417_screen738374124412">GET /_access_log</pre>
</li><li id="css_01_0146__en-us_topic_0000001272932417_li2383441134411">API for checking the access logs of a node in a cluster<pre class="screen" id="css_01_0146__en-us_topic_0000001272932417_screen1138317410441">GET /_access_log/<em id="css_01_0146__en-us_topic_0000001272932417_i1074711914454">{nodeId}</em></pre>
<p id="css_01_0146__en-us_topic_0000001272932417_p1638374112449"><em id="css_01_0146__en-us_topic_0000001272932417_i198691544131613">{nodeId}</em> indicates the ID of the node where you want to enable access logs.</p>
</li></ul>
<div class="p" id="css_01_0146__en-us_topic_0000001272932417_p1544125964311">Example response:<pre class="screen" id="css_01_0146__en-us_topic_0000001272932417_screen195443596430">{
"_nodes" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"cluster_name" : "css-flowcontroller",
"nodes" : {
"8x-ZHu-wTemBQwpcGivFKg" : {
"name" : "css-flowcontroller-ess-esn-1-1",
"host" : "10.0.0.98",
"count" : 2,
"access" : [
{
"time" : "2021-02-23 02:09:50",
"remote_address" : "/10.0.0.98:28191",
"url" : "/_access/security/log?pretty",
"method" : "GET",
"content" : ""
},
{
"time" : "2021-02-23 02:09:52",
"remote_address" : "/10.0.0.98:28193",
"url" : "/_access/security/log?pretty",
"method" : "GET",
"content" : ""
}
]
}
}
}</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0146__en-us_topic_0000001272932417_table79421457173012" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameters</caption><thead align="left"><tr id="css_01_0146__en-us_topic_0000001272932417_row12943105753011"><th align="left" class="cellrowborder" valign="top" width="28.59%" id="mcps1.3.2.2.4.2.2.2.3.1.1"><p id="css_01_0146__en-us_topic_0000001272932417_p1494335719307">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="71.41%" id="mcps1.3.2.2.4.2.2.2.3.1.2"><p id="css_01_0146__en-us_topic_0000001272932417_p199431457183013">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_01_0146__en-us_topic_0000001272932417_row194320579307"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.2.2.4.2.2.2.3.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p894310579302">name</p>
</td>
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.2.2.4.2.2.2.3.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p59431557113017">Node name</p>
</td>
</tr>
<tr id="css_01_0146__en-us_topic_0000001272932417_row69435575302"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.2.2.4.2.2.2.3.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p09431057113020">host</p>
</td>
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.2.2.4.2.2.2.3.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p8943657193020">Node IP address</p>
</td>
</tr>
<tr id="css_01_0146__en-us_topic_0000001272932417_row694345717303"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.2.2.4.2.2.2.3.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p13943115753016">count</p>
</td>
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.2.2.4.2.2.2.3.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p494375723012">Number of node access requests in a statistical period</p>
</td>
</tr>
<tr id="css_01_0146__en-us_topic_0000001272932417_row1994312574305"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.2.2.4.2.2.2.3.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p189431657143012">access</p>
</td>
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.2.2.4.2.2.2.3.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p13943125716308">Details about node access requests in a statistical period For details, see <a href="#css_01_0146__en-us_topic_0000001272932417_table1631713296470">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="tablenoborder"><a name="css_01_0146__en-us_topic_0000001272932417_table1631713296470"></a><a name="en-us_topic_0000001272932417_table1631713296470"></a><table cellpadding="4" cellspacing="0" summary="" id="css_01_0146__en-us_topic_0000001272932417_table1631713296470" frame="border" border="1" rules="all"><caption><b>Table 3 </b>access</caption><thead align="left"><tr id="css_01_0146__en-us_topic_0000001272932417_row16317172984720"><th align="left" class="cellrowborder" valign="top" width="28.59%" id="mcps1.3.2.2.4.3.2.3.1.1"><p id="css_01_0146__en-us_topic_0000001272932417_p13317102913475">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="71.41%" id="mcps1.3.2.2.4.3.2.3.1.2"><p id="css_01_0146__en-us_topic_0000001272932417_p3317162913477">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_01_0146__en-us_topic_0000001272932417_row143177294475"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.2.2.4.3.2.3.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p14317202934714">time</p>
</td>
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.2.2.4.3.2.3.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p831762954714">Request time</p>
</td>
</tr>
<tr id="css_01_0146__en-us_topic_0000001272932417_row2317129154710"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.2.2.4.3.2.3.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p73174296477">remote_address</p>
</td>
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.2.2.4.3.2.3.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p8317129104714">Source IP address and port number of the request</p>
</td>
</tr>
<tr id="css_01_0146__en-us_topic_0000001272932417_row9317929144716"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.2.2.4.3.2.3.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p5317152984716">url</p>
</td>
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.2.2.4.3.2.3.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p4317729194714">Original URL of the request</p>
</td>
</tr>
<tr id="css_01_0146__en-us_topic_0000001272932417_row13177291478"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.2.2.4.3.2.3.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p83174298476">method</p>
</td>
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.2.2.4.3.2.3.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p20317629164716">Method corresponding to the request path</p>
</td>
</tr>
<tr id="css_01_0146__en-us_topic_0000001272932417_row531742910476"><td class="cellrowborder" valign="top" width="28.59%" headers="mcps1.3.2.2.4.3.2.3.1.1 "><p id="css_01_0146__en-us_topic_0000001272932417_p193171329184713">content</p>
</td>
<td class="cellrowborder" valign="top" width="71.41%" headers="mcps1.3.2.2.4.3.2.3.1.2 "><p id="css_01_0146__en-us_topic_0000001272932417_p1331722915477">Request content</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="css_01_0146__en-us_topic_0000001272932417_li95401727164910">Enable or disable the access log function.<p id="css_01_0146__en-us_topic_0000001272932417_p114611210501"><a name="css_01_0146__en-us_topic_0000001272932417_li95401727164910"></a><a name="en-us_topic_0000001272932417_li95401727164910"></a>All user access operation can be logged. By default, logs are recorded in the <strong id="css_01_0146__en-us_topic_0000001272932417_b172901212223">acces_log.log</strong> file in the background. The maximum size of a log file is 250 MB, and there can be a maximum of five log files. You can back up access log files to OBS.</p>
<ul id="css_01_0146__en-us_topic_0000001272932417_ul6711123155011"><li id="css_01_0146__en-us_topic_0000001272932417_li10711531105012">Enabling access logs<pre class="screen" id="css_01_0146__en-us_topic_0000001272932417_screen112121526155020">PUT /_cluster/settings
{
"persistent": {
"flowcontrol.accesslog.enabled": true
}
}</pre>
</li><li id="css_01_0146__en-us_topic_0000001272932417_li1571123165013">Disabling access logs<pre class="screen" id="css_01_0146__en-us_topic_0000001272932417_screen151449578503">PUT /_cluster/settings
{
"persistent": {
"flowcontrol.accesslog.enabled": false
}
}</pre>
</li></ul>
</li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0139.html">Flow Control 1.0</a></div>
</div>
</div>