-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: modal implementation for data ingestion table (#1244)
**Issue number:** [ADDON-70993](https://splunk.atlassian.net/browse/ADDON-70993), [ADDON-72969](https://splunk.atlassian.net/browse/ADDON-72969) ## Summary ### Changes > Added a modal for data ingestion table view to show the specific data for input selector. ### User experience > Users can see the data volume and number of events visualization chart for the particular row using the modal popup in data ingestion table. ## Checklist If your change doesn't seem to apply, please leave them unchecked. * [x] I have performed a self-review of this change * [x] Changes have been tested * [x] Changes are documented * [x] PR title follows [conventional commit semantics](https://www.conventionalcommits.org/en/v1.0.0/) --------- Co-authored-by: sgoral <[email protected]> Co-authored-by: rohanm-crest <[email protected]> Co-authored-by: srv-rr-github-token <[email protected]> Co-authored-by: rohanm-crest <[email protected]>
- Loading branch information
1 parent
139a47a
commit 8246870
Showing
24 changed files
with
1,416 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
splunk_add_on_ucc_framework/templates/data_ingestion_modal_definition.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
{ | ||
"visualizations": { | ||
"data_ingestion_modal_timerange_label_start_viz": { | ||
"type": "splunk.singlevalue", | ||
"options": { | ||
"majorFontSize": 12, | ||
"backgroundColor": "transparent", | ||
"majorColor": "#9fa4af" | ||
}, | ||
"dataSources": { | ||
"primary": "data_ingestion_modal_data_time_label_start_ds" | ||
} | ||
}, | ||
"data_ingestion_modal_timerange_label_end_viz": { | ||
"type": "splunk.singlevalue", | ||
"options": { | ||
"majorFontSize": 12, | ||
"backgroundColor": "transparent", | ||
"majorColor": "#9fa4af" | ||
}, | ||
"dataSources": { | ||
"primary": "data_ingestion_modal_data_time_label_end_ds" | ||
} | ||
}, | ||
"data_ingestion_modal_data_volume_viz": { | ||
"type": "splunk.line", | ||
"options": { | ||
"xAxisVisibility": "hide", | ||
"seriesColors": ["#A870EF"], | ||
"yAxisTitleText": "Volume (bytes)", | ||
"xAxisTitleText": "Time" | ||
}, | ||
"title": "Data volume", | ||
"dataSources": { | ||
"primary": "data_ingestion_modal_data_volume_ds" | ||
} | ||
}, | ||
"data_ingestion_modal_events_count_viz": { | ||
"type": "splunk.line", | ||
"options": { | ||
"xAxisVisibility": "hide", | ||
"xAxisTitleText": "Time", | ||
"seriesColors": ["#A870EF"], | ||
"yAxisTitleText": "Number of events" | ||
}, | ||
"title": "Number of events", | ||
"dataSources": { | ||
"primary": "ds_search_1" | ||
} | ||
} | ||
}, | ||
"dataSources": { | ||
"data_ingestion_modal_data_time_label_start_ds": { | ||
"type": "ds.search", | ||
"options": { | ||
"query": "| makeresults | addinfo | eval StartDate = strftime(info_min_time, \"%e %b %Y %I:%M%p\") | table StartDate", | ||
"queryParameters": { | ||
"earliest": "$data_ingestion_modal_time.earliest$", | ||
"latest": "$data_ingestion_modal_time.latest$" | ||
} | ||
} | ||
}, | ||
"data_ingestion_modal_data_time_label_end_ds": { | ||
"type": "ds.search", | ||
"options": { | ||
"query": "| makeresults | addinfo | eval EndDate = strftime(info_max_time, \"%e %b %Y %I:%M%p\") | table EndDate", | ||
"queryParameters": { | ||
"earliest": "$data_ingestion_modal_time.earliest$", | ||
"latest": "$data_ingestion_modal_time.latest$" | ||
} | ||
} | ||
}, | ||
"data_ingestion_modal_data_volume_ds": { | ||
"type": "ds.search", | ||
"options": { | ||
"query": "{{data_ingestion}}", | ||
"queryParameters": { | ||
"earliest": "$data_ingestion_modal_time.earliest$", | ||
"latest": "$data_ingestion_modal_time.latest$" | ||
} | ||
} | ||
}, | ||
"ds_search_1": { | ||
"type": "ds.search", | ||
"options": { | ||
"query": "{{events_count}}", | ||
"queryParameters": { | ||
"earliest": "$data_ingestion_modal_time.earliest$", | ||
"latest": "$data_ingestion_modal_time.latest$" | ||
} | ||
}, | ||
"name": "Security Score vs Spend" | ||
} | ||
}, | ||
"defaults": {}, | ||
"inputs": { | ||
"data_ingestion_modal_time_window": { | ||
"options": { | ||
"defaultValue": "-24h,now", | ||
"token": "data_ingestion_modal_time" | ||
}, | ||
"title": "Time Window", | ||
"type": "input.timerange" | ||
} | ||
}, | ||
"layout": { | ||
"type": "grid", | ||
"globalInputs": ["data_ingestion_modal_time_window"], | ||
"structure": [ | ||
{ | ||
"item": "data_ingestion_modal_timerange_label_start_viz", | ||
"position": { | ||
"x": 0, | ||
"y": 50, | ||
"w": 100, | ||
"h": 20 | ||
} | ||
}, | ||
{ | ||
"item": "data_ingestion_modal_timerange_label_end_viz", | ||
"position": { | ||
"x": 100, | ||
"y": 50, | ||
"w": 100, | ||
"h": 20 | ||
} | ||
}, | ||
{ | ||
"item": "data_ingestion_modal_data_volume_viz", | ||
"position": { | ||
"x": 0, | ||
"y": 80, | ||
"w": 300, | ||
"h": 400 | ||
} | ||
}, | ||
{ | ||
"item": "data_ingestion_modal_events_count_viz", | ||
"position": { | ||
"x": 0, | ||
"y": 500, | ||
"w": 300, | ||
"h": 400 | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...s/testdata/test_addons/package_global_config_everything/package/bin/example_input_four.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import import_declare_test | ||
|
||
import json | ||
import sys | ||
from time import time | ||
|
||
from splunklib import modularinput as smi | ||
from solnlib import log | ||
|
||
logger = log.Logs().get_logger('splunk_ta_uccexample_four') | ||
|
||
|
||
class EXAMPLE_INPUT_FOUR(smi.Script): | ||
def __init__(self): | ||
super(EXAMPLE_INPUT_FOUR, self).__init__() | ||
|
||
def get_scheme(self): | ||
scheme = smi.Scheme('example_input_four') | ||
scheme.description = 'Example Input Four' | ||
scheme.use_external_validation = True | ||
scheme.streaming_mode_xml = True | ||
scheme.use_single_instance = False | ||
|
||
scheme.add_argument( | ||
smi.Argument( | ||
'name', | ||
title='Name', | ||
description='Name', | ||
required_on_create=True | ||
) | ||
) | ||
return scheme | ||
|
||
def validate_input(self, definition: smi.ValidationDefinition): | ||
return | ||
|
||
def stream_events(self, inputs: smi.InputDefinition, ew: smi.EventWriter): | ||
input_items = [{'count': len(inputs.inputs)}] | ||
input_name_1 = "" | ||
for input_name, input_item in inputs.inputs.items(): | ||
input_item['name'] = input_name | ||
input_name_1 = input_name | ||
input_items.append(input_item) | ||
|
||
sourcetype = f'example_input_four-st--{input_name_1.split("://")[-1]}' | ||
host = f'host--{input_name_1.split("://")[-1]}' | ||
|
||
event = smi.Event( | ||
data=json.dumps(input_items), | ||
sourcetype=sourcetype, | ||
host=host, | ||
source=input_name_1, | ||
) | ||
log.events_ingested(logger, input_name_1, sourcetype, | ||
str(time())[-3:], "main", "no_account_4", host) | ||
ew.write_event(event) | ||
|
||
|
||
if __name__ == '__main__': | ||
exit_code = EXAMPLE_INPUT_FOUR().run(sys.argv) | ||
sys.exit(exit_code) |
Oops, something went wrong.