Hi Kashif, thanks for taking the time to post your question here.
I tried to create a sample index with those same fields and added some sample data. If I understood your problem correctly, you can do the following to get the visualization you need.
You create a 'Vertical Bar' visualization
Then for the Metric, you select Sum as the aggregation and it will ask you to select a field, which in your case will be session_duration_in_seconds.
You create buckets according to your date field and specify the time interval.
Once you have done this, you get buckets (vertical bars) that represent the summation of the session_duration_in_seconds for all users across time.
Since you want the analysis to be for a specific user, you create a filter at the top (below the search bar) and select user_id:<your user>.
Now the analysis should only be performed for that particular user.
To select the desired timeframe just use the time filter at the top right.
Hopefully, it helps, and below is a snapshot of how I rendered the visualization. Let me know if this is what you were looking for? Otherwise, we can discuss more of the issue at hand. Thanks!
If you just want to display those values in minutes or hours, you can try using a scripted field.
Go into Management and select the index pattern you are working with and then create a scripted field. Then give it a name and use something like below:
for minutes: doc['session_duration_in_seconds'].value / 60
OR
for hours: doc['session_duration_in_seconds'].value / 3600
You can create both of them as separate scripted fields so you have access to both of them in the Data Table visualization.
When you are in the Table visualization, select a new Metric (could be Max) and pick the newly created scripted field.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.