Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nablaone committed May 14, 2024
1 parent 696d881 commit c034623
Show file tree
Hide file tree
Showing 10 changed files with 499 additions and 399 deletions.
6 changes: 4 additions & 2 deletions quesma/e2e/assets/compare_requests/01-eql-search.http
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
POST http://localhost:8080/windows_logs/_eql/search
POST http://localhost:9201/windows_logs/_eql/search
Content-type: application/json
#eq /hits/total/value
#eq /hits/events/0/_source/event/category /hits/events/0/_source/event::category
#eq /hits/events/0/_source/process/name /hits/events/0/_source/process::name

{
"query": "REPLAYID where true"
"query": "process where true"
}

16 changes: 13 additions & 3 deletions quesma/e2e/assets/compare_requests/02-device-logs-search.http
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
POST http://quesma:8080/device_logs/_search
POST http://localhost:9201/device_logs/_search
Content-Type: application/json
#eq /hits/total/value
# elastic didn't return {hits: {total: {value: 0}}} when there is no data
#
#eq /hits/hits/0/_index
#eq /hits/hits/0/fields/dedup_id
## timestamp format is different
#SKIP eq /hits/hits/0/fields/epoch_time
#eq /hits/hits/0/fields/event_name
#eq /hits/hits/0/fields/hostname
#eq /hits/hits/0/fields/log_level
#eq /hits/hits/0/fields/message


{
"_source": false,
Expand Down Expand Up @@ -40,7 +50,7 @@ Content-Type: application/json
{
"term": {
"event_name": {
"value": "REPLAYID"
"value": "test"
}
}
}
Expand Down
75 changes: 75 additions & 0 deletions quesma/e2e/assets/compare_requests/03-device-logs-all-search.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
POST http://localhost:9201/device_logs/_search
Content-Type: application/json
#eq /hits/hits/0/_index

{
"_source": false,
"fields": [
{
"field": "*",
"include_unmapped": "true"
},
{
"field": "epoch_time",
"format": "strict_date_optional_time"
},
{
"field": "ts_time_druid",
"format": "strict_date_optional_time"
}
],
"highlight": {
"fields": {
"*": {}
},
"fragment_size": 2147483647,
"post_tags": [
"@/kibana-highlighted-field@"
],
"pre_tags": [
"@kibana-highlighted-field@"
]
},
"query": {
"bool": {
"filter": [

{
"range": {
"epoch_time": {
"format": "strict_date_optional_time",
"gte": "2000-01-01T00:00:00.000Z",
"lte": "2000-01-02T00:00:00.000Z"
}
}
}
],
"must": [],
"must_not": [],
"should": []
}
},
"runtime_mappings": {},
"script_fields": {},
"size": 500,
"sort": [
{
"epoch_time": {
"format": "strict_date_optional_time",
"order": "desc",
"unmapped_type": "boolean"
}
},
{
"_doc": {
"order": "desc",
"unmapped_type": "boolean"
}
}
],
"stored_fields": [
"*"
],
"track_total_hits": false,
"version": true
}
19 changes: 19 additions & 0 deletions quesma/e2e/assets/compare_requests/03-field-caps.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
POST http://localhost:8080/device_logs/_field_caps
Content-Type: application/json
## We do not return the same fields configuration as elastic
#SKIP eq /fields/client_id
# we can compare only a subset of field properties
#eq /fields/client_id/searchable
#eq /fields/client_ip/searchable
#eq /fields/text/searchable
#eq /fields/dedup_id/searchable
#eq /fields/epoch_time/searchable
#eq /fields/et_day/searchable
#eq /fields/event_name/searchable
#eq /fields/event_section/searchable

{
"fields": [
"*"
]
}
57 changes: 57 additions & 0 deletions quesma/e2e/assets/compare_requests/04-histogram.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
POST http://localhost:8080/device_logs/_search HTTP/1.1
Content-Type: application/json
#eq /hits/total/value

{
"_source": {
"excludes": []
},
"aggs": {
"0": {
"date_histogram": {
"extended_bounds": {
"max": 1715685298265,
"min": 1715685261417
},
"field": "epoch_time",
"fixed_interval": "1s",
"time_zone": "Europe/Warsaw"
}
}
},
"fields": [
{
"field": "epoch_time",
"format": "date_time"
},
{
"field": "ts_time_druid",
"format": "date_time"
}
],
"query": {
"bool": {
"filter": [
{
"range": {
"epoch_time": {
"format": "strict_date_optional_time",
"gte": "2024-05-14T11:14:21.417Z",
"lte": "2024-05-14T11:14:58.265Z"
}
}
}
],
"must": [],
"must_not": [],
"should": []
}
},
"runtime_mappings": {},
"script_fields": {},
"size": 0,
"stored_fields": [
"*"
],
"track_total_hits": true
}
4 changes: 2 additions & 2 deletions quesma/e2e/assets/compare_requests/bulk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{"create":{"_index":"windows_logs"}}
{"process":{"name":"Test","pid":1,"entity_id":"1","executable":"Test"},"@timestamp":"1970-01-01T01:00:00+01:00","event":{"category":"@@REPLAYID@@","type":"start"}}
{"process":{"name":"Test","pid":1,"entity_id":"1","executable":"Test"},"@timestamp":"1970-01-01T01:00:00+01:00","event":{"category":"process","type":"start"}}
{"create":{"_index":"device_logs"}}
{"client_id":"dh.56e88eb4","client_ip":"2409:4070:4003:a299:40f9:28e1:8d2b:1aef","dedup_id":"hashtag8535ca2e98a4cfc7bc483e91a69b2cc2hashtag","epoch_time":"2000-01-01T12:00:00+0000","epoch_time_original":1704129690,"et_day":"2024.05.14","et_day_hour":"2024.05.14.09","event_name":"REPLAYID","event_section":"non-news","properties":{"ab_NewsStickyType":"TYPE3","app_id":"DH_APP","card_count":10,"country_detection_mechanism":"network_country","enriched_app_id":"DH","enriched_client_ip":"2409:4070:4003:a299:40f9:28e1:3f76:9cda","enriched_event_attribution":"deep_link","enriched_user_id":"dh56e88eb4","enriched_user_language_primary":"te","entry_time":1704129696028,"estimated_connection_speedinkbps":23067.048828125,"event_attribution":"deep_link","exoestimation_connection_speedinkbps":8875,"fbestimation_connection_speedinkbps":23067.048828125,"feed_latency":"1269","fg_session_count":244,"fg_session_duration":6384,"fg_session_id":"6e5c7cf6-20b5-4d16-7776-73c81f95b5fc","ftd_session_count":202,"ftd_session_time":6560,"is_in_fg":false,"isreg":false,"latest_pagenumber":"7","network_service_provider":"AAA 4G","pv_event":"false","referrer_action":"scroll","selected_country":"in","server_loc":"#,#,c32_800,s32,","session_id":"525a1585-b211-480b-e96c-70ffc8fe34c4","session_start_time":"2024-01-01T22:25:21+0530","signed_state":"signed_out","signin_medium":"MOBILE","tabindex":0,"tabitem_id":"38ddbd0c786113497b8ac68b32aacf7b","tabname":"మీ కోసం","tabtype":"hashtag","time_taken_for_network_operation":2497,"user_app_ver":"27.2.9","user_connection":"5G","user_connection_quality":"average","user_feed_type":"LR","user_handset_maker":"Google","user_handset_model":"Google Pixel 6","user_language_primary":"te","user_os_name":"rel","user_os_ver":"9","user_type":"admin"},"timestamps":{"topology_entry_time":"2024-05-14T22:51:36+0530"},"ts_day":"2024-05-14","ts_day_hour":"2024-05-14-22","ts_time_druid":"2024-05-14T22:00:00","user_id":"dh56e88eb49"}
{"client_id":"dh.56e88eb4","client_ip":"2409:4070:4003:a299:40f9:28e1:8d2b:1aef","dedup_id":"hashtag8535ca2e98a4cfc7bc483e91a69b2cc2hashtag","epoch_time":"2000-01-01T12:00:00+0000","epoch_time_original":1704129690,"et_day":"2024.05.14","et_day_hour":"2024.05.14.09","event_name":"test","event_section":"non-news","properties":{"ab_NewsStickyType":"TYPE3","app_id":"DH_APP","card_count":10,"country_detection_mechanism":"network_country","enriched_app_id":"DH","enriched_client_ip":"2409:4070:4003:a299:40f9:28e1:3f76:9cda","enriched_event_attribution":"deep_link","enriched_user_id":"dh56e88eb4","enriched_user_language_primary":"te","entry_time":1704129696028,"estimated_connection_speedinkbps":23067.048828125,"event_attribution":"deep_link","exoestimation_connection_speedinkbps":8875,"fbestimation_connection_speedinkbps":23067.048828125,"feed_latency":"1269","fg_session_count":244,"fg_session_duration":6384,"fg_session_id":"6e5c7cf6-20b5-4d16-7776-73c81f95b5fc","ftd_session_count":202,"ftd_session_time":6560,"is_in_fg":false,"isreg":false,"latest_pagenumber":"7","network_service_provider":"AAA 4G","pv_event":"false","referrer_action":"scroll","selected_country":"in","server_loc":"#,#,c32_800,s32,","session_id":"525a1585-b211-480b-e96c-70ffc8fe34c4","session_start_time":"2024-01-01T22:25:21+0530","signed_state":"signed_out","signin_medium":"MOBILE","tabindex":0,"tabitem_id":"38ddbd0c786113497b8ac68b32aacf7b","tabname":"మీ కోసం","tabtype":"hashtag","time_taken_for_network_operation":2497,"user_app_ver":"27.2.9","user_connection":"5G","user_connection_quality":"average","user_feed_type":"LR","user_handset_maker":"Google","user_handset_model":"Google Pixel 6","user_language_primary":"te","user_os_name":"rel","user_os_ver":"9","user_type":"admin"},"timestamps":{"topology_entry_time":"2024-05-14T22:51:36+0530"},"ts_day":"2024-05-14","ts_day_hour":"2024-05-14-22","ts_time_druid":"2024-05-14T22:00:00","user_id":"dh56e88eb49"}

Loading

0 comments on commit c034623

Please sign in to comment.