Previously, tried creating a slider based on datetime, but could not get the slider to work down to the millisecond. My work around was to abstract the timestamp to a line number and provide a slider so they can filter lines down to the approximate timestamps they are looking for within the logcat.
Users do not really like this experience–which I agree with from their perspective.
Is there a way to have the slider use timestamps rather than line numbers?
Is there a way to use a user input field to search for a timestamp range instead?
No - the date control is calendar date resolution only. You’d have to add one or more number input widgets to capture the sub-day time resolution you want, and combine all values to filter your data set.
How can I submit a feature request to allow for the inclusion of timestamp values? I will try to encode the timestamp as an integer next and see if that would work.
def renderDf(df):
#Set up the tag filter for log message
keyword = streamlitTags.st_tags_sidebar(label='Search Log Message',text='Add tags to Search Log Messages',suggestions=['five'],maxtags = -1)
keyword = '|'.join(keyword)
#Instantiate the priorities filter
priorities = df['priority'].unique().tolist()
prioritySelection = st.sidebar.multiselect('Select Log Line Priority',priorities,default=priorities)
#Instantiate the proxy filter since Streamlit is not super flexible with filtering
minLine=min(df['lineNum'])
maxLine=max(df['lineNum'])
dtSelection=st.sidebar.slider("Filter Line Number",0,1,(minLine,maxLine))
#Set up the tag filter for apps Tags
apps = df['app'].unique().tolist()
keywordTags = streamlitTags.st_tags_sidebar(label='Search Apps',text='Add tags to Search Apps',suggestions=apps,maxtags = -1)
keywordT = '|'.join(keywordTags)
#create the dataframe and nest all of the filters together so they work 'somewhat' in tandem. Streamlit doesnt have a great way of chaining filters like a PowerBI or Tableau
df = df[(df.priority.isin(prioritySelection)) & (df.lineNum.between(dtSelection[0], dtSelection[1])) & (df.app.str.contains(keywordT)) & (df.message.str.contains(keyword))]
st.dataframe(df)
startDate = min(df.index)
enDate = max(df.index)
st.info('Start: **%s** End: **%s**' % (startDate,enDate))
st.markdown('This script has already written the parsed log files to a csv called "parsedLogs.csv" in the current working directory')
renderDf(df)```
it is not a perfect solution by any means, but it at least gives a better visual indicator of what the line number equates to a timestamp range