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
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.