marcusschiesser / kveditor Goto Github PK
View Code? Open in Web Editor NEWSplunk-UI React component to generically edit Splunk's KV stores
License: MIT License
Splunk-UI React component to generically edit Splunk's KV stores
License: MIT License
definition.json
via the attribute sortable
We need to add/modify events of the current Table component such as:
The Table component might not be sufficient, so we probably have to extend the currently unused ReadOnlyTable
All entries of the CSV must be stored in the Splunk KV Store Collection.
There's already a method to modify one entry: https://github.com/marcusschiesser/kveditor/blob/44d5f0505593bf28b54d28cd19cc53f606d9d160/packages/edit-table/src/data.js
Here's the REST API to modify a Splunk Collection:
https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/kvstore/usetherestapitomanagekv/
There's a batch operation which should be helpful to store multiple entries
definition.json
via the attribute searchable
Currently, the endpoint supports pagination, sorting, projection, and query by exact string. The API also support sort and search by one or multiple fields. The API didn't support query by a substring (we have to wait here for a new Splunk release).
Eg: To get the first 10 entries which have "Title"
="Mean"
and sort by "Score"
. We can use this query:
/storage/collections/data/${collection}?sort=Score&skip=0&limit=10&query={"Title":"Mean"}
see discussion in #8 - we want this to implement the priority field from como
yarn start
- Dockerfile of the Splunk instance will be in the root container here and be similar to the one of the splunk
folder in comoAs recommendation by @splunk/react-ui, we can use inline css for simple style, for example: <P style={{ width: 500 }}>
.
For complex CSS with multiple properties such as:
<div
style={{
display: 'flex',
width: 'fit-content',
marginLeft: 'auto',
marginTop: '2rem',
}}
>
We should use styled component to make the code cleaner:
const ButtonActionGroup = styled.div`
display: flex;
width: fit-content;
margin-left: auto;
margin-top: 2rem;
`;
Currently, the data is updated by calling updateKVEntry(COLLECTION_NAME...
, but it is loaded by the SPL query | inputlookup example_kv
defined in the definition.json
.
The DashboardExample.jsx
is using the definition.json
to call this query at run-time (actually the DashboardCore
component of the Splunk UI framework is doing this) and forwarding the retrieved data via the dataSources
property to the EditTable
component as an array.
It is important to remember that DashboardCore
is calling the SPL queries - the components in definition.json
are just rendering data - they are not retrieving data from Splunk.
To force a data refresh (re-loading the modified data), EditTable
is calling api.refreshVisualization(id)
which triggers that the DashboardCore
should reload the data.
The name of the collection that we're using is specified in
dataSources
can then be removed.kveditor/splunk/packages/edit-table/src/data.js
Lines 96 to 112 in 2a53412
Because we won't use the data from datasources in the dashboard definition file, we need to refactor Editable
component. Because datasources
are currently being used in many places (including download/upload feature), so refactoring will take some effort.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.