submit.py not working
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with submit.py and the .env settings, then reproduce the documented python3 submit.py command while inspecting the generated request. Compare the GET request and 404 response with the working POST request shown in the issue. Done means identifying the request or configuration mismatch and confirming that the example can submit an event successfully.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Trying to run the submit.py from the freshly-cloned examples, I keep getting the same error: Index 'foo' does not exist. This is repeated for all indexes I tried -- which I do know exist, because I use them routinely both to submit events using Java API, as well as for searches, dashboards, and alerts.
Using tcpdump I was able to intercept the HTTP-traffic... When I invoke the sample program as:
python3 submit.py --sourcetype=cmdline foo 'Hello, world!'
the client sends:
GET /services/data/indexes/foo HTTP/1.1
Accept-Encoding: identity
Content-Length: 0
Host: kachka
User-Agent: splunk-sdk-python/1.7.2
Accept: */*
Connection: Close
Authorization: Splunk my-submission-only-token
to which the server invariably replies:
HTTP/1.1 404 Not Found
Date: Thu, 15 Dec 2022 19:07:08 GMT
Content-Length: 196
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
</body></html>
Our Splunk servers run:
Splunk Enterprise
Version:
8.2.6.1
Build:
5f0da8f6e22c
I tried both UPPER and lower case for each index -- to no avail... Submission of new events from Java -- to the same index and with the same token -- works just fine. A request like:
POST /services/collector/event/1.0 HTTP/1.1
Authorization: Splunk my-submission-only-token
Content-Length: 288
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.9.0
{ ... "index":"foo", ...}
gets the expected status 200:
HTTP/1.1 200 OK
Date: Thu, 15 Dec 2022 19:17:33 GMT
Server: Splunkd
Content-Type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 27
Vary: Authorization
X-Frame-Options: SAMEORIGIN
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
{"text":"Success","code":0}
We also have Python code already, that uses the requests-module directly to submit events to Splunk (using POST). It works Ok, but we thought, it would be more prudent to switch to Splunk's own client-implementation... Unfortunately, we cannot get even the pre-canned example (like submit.py) to work...
What am I doing wrong? Is my token no good for any GET-requests, perhaps? The .env file is:
host=....
port=...
scheme=http
version=8.2
token=Splunk my-submission-only-token
- Ngôn ngữ chính
- JavaScript
- Star
- 155
- Fork
- 84
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của splunk/splunk-app-examples
-
Probable mistake in restmap.confĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
splunk/splunk-app-examples#67 · 1 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
splunk/splunk-app-examples#65 · 1 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 32/100
splunk/splunk-app-examples#48 · 2 bình luận ·
Tất cả issue của splunk/splunk-app-examples
Issue tương tự
-
accessibility area: css area: web ui bug difficulty: easy frontend good first issue help wanted javascript journey: first-visit journey: mobile priority: P3 quality tech: css tech: html typescript ui user-experience
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[analytics-core] getQueryParams does not decode `+` as space and truncates values containing `=`Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
amplitude/Amplitude-TypeScript#2179 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
ci: raise .github/workflows/test.yml timeout-minutes from 20 to 35 as suite exceeds 30,899 testsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Jason-Vaughan/TangleClaw#3075 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(frontend): resolve SSE parser crash on unhandled Ref methods and undefined actions identifierĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kodokbakar/MiroFish-Local#94 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
framework/gatsby help wanted kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày