<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Time Conversion During Search Runtime in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588445#M204946</link>
    <description>&lt;P&gt;That's what the rest of my previous answer does i.e. converts the extracted values to seconds&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 15:38:04 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-03-10T15:38:04Z</dc:date>
    <item>
      <title>How to do time conversion during search runtime?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588417#M204934</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;We got an requirement to create a report based on the accessed time present in the logs here in the logs the time is present with seconds, milliseconds, microseconds, nanoseconds value.&lt;/P&gt;
&lt;P&gt;Example:&amp;nbsp;1s79ms874µs907ns So here in this case how to convert them into a unique value.&amp;nbsp; So post which we need to check and create a report for the same. In most of the cases the time is getting started with milliseconds and in few cases the time information is getting started with seconds.&lt;/P&gt;
&lt;P&gt;So how to convert the time (1s79ms874µs907ns) to an unique value either in seconds, milliseconds , microseconds or nanoseconds so then only we can able to create a report for the same.&lt;/P&gt;
&lt;P&gt;Or do we have any other option to fix this issue while searching the logs during runtime.&lt;/P&gt;
&lt;P&gt;So kindly help on my request.&lt;/P&gt;
&lt;P&gt;Sample Logs for Reference:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DEBUG 2022-03-10 07:17:26,239 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: abcdefgh-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 145ms227µs975ns ago, IN_USE
DEBUG 2022-03-10 07:07:26,239 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: ijklmnop-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 1s79ms874µs907ns ago, IN_USE
DEBUG 2022-03-10 07:02:26,238 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: qrstuvwx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 7ms215µs946ns ago, IN_USE
DEBUG 2022-03-10 06:57:26,237 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: qrstuvwx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 168ms259µs830ns ago, IN_USE
DEBUG 2022-03-10 06:57:26,237 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: abcdefgh-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 6s993ms781µs523ns ago, IN_USE
DEBUG 2022-03-10 06:47:26,238 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: ijklmnop-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 2ms593µs888ns ago, IN_USE
DEBUG 2022-03-10 06:47:26,238 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: qrstuvwx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 55ms239µs616ns ago, IN_USE
DEBUG 2022-03-10 06:47:26,238 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: abcdefgh-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 957ms778µs205ns ago, IN_USE
DEBUG 2022-03-10 06:47:26,238 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: ijklmnop-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 45ms536µs884ns ago, IN_USE
DEBUG 2022-03-10 06:47:26,238 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: qrstuvwx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 22ms906µs437ns ago, IN_USE
DEBUG 2022-03-10 06:47:26,238 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: abcdefgh-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 46ms556µs466ns ago, IN_USE
DEBUG 2022-03-10 06:42:26,236 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: ijklmnop-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 3s286ms410µs997ns ago, IN_USE
DEBUG 2022-03-10 06:37:26,239 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: qrstuvwx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 842ms323µs432ns ago, IN_USE
DEBUG 2022-03-10 06:27:26,236 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: abcdefgh-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 7ms698µs576ns ago, IN_USE
DEBUG 2022-03-10 06:27:26,236 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: ijklmnop-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 18ms948µs359ns ago, IN_USE
DEBUG 2022-03-10 06:17:26,236 [Timer-x] com.abc.valid.AppData - EntryData &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;ConnectionID:xxxxx ClientConnectionId: qrstuvwx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, accessed 257ms32µs814ns ago, IN_USE&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2022 06:02:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588417#M204934</guid>
      <dc:creator>anandhalagaras1</dc:creator>
      <dc:date>2022-03-12T06:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588423#M204938</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;seconds&amp;gt;\d+)s"
| rex "(?&amp;lt;milli&amp;gt;\d+)ms"
| rex "(?&amp;lt;micro&amp;gt;\d+)µs"
| rex "(?&amp;lt;nano&amp;gt;\d+)ns"
| fillnull value=0 seconds milli micro nano
| eval seconds=round(seconds+(((((nano/1000)+micro)/1000)+milli)/1000),9)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Mar 2022 13:59:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588423#M204938</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-10T13:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588425#M204940</link>
      <description>&lt;P&gt;I'd say that single regex would be a nicer solution. In this case probably the efficiency won't matter that much but in general single strict regex is usually better performing than four separate ones.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 14:05:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588425#M204940</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-03-10T14:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588434#M204943</link>
      <description>&lt;P&gt;Yes, a single rex might be better if you can assume that (at least) one of the units is always present .e.g ns&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "((?&amp;lt;seconds&amp;gt;\d+)s)?((?&amp;lt;milli&amp;gt;\d+)ms)?((?&amp;lt;micro&amp;gt;\d+)µs)?(?&amp;lt;nano&amp;gt;\d+)ns"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Mar 2022 14:20:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588434#M204943</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-10T14:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588444#M204945</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you. Now I can see the fields are getting extracted as desired. Our requirement is to create a report for the same i.e. If the total time taken is taking longer than expected then we need to get an alert and also if it comes under a visualization has a graph then it will be good as well.&lt;/P&gt;&lt;P&gt;So is there any possibility to convert the value of seconds, nanoseconds, milliseconds &amp;amp; microseconds in a event to a single value. If yes then we can try to get a visualization as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help on the same.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 15:34:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588444#M204945</guid>
      <dc:creator>anandhalagaras1</dc:creator>
      <dc:date>2022-03-10T15:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588445#M204946</link>
      <description>&lt;P&gt;That's what the rest of my previous answer does i.e. converts the extracted values to seconds&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 15:38:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/588445#M204946</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-10T15:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592597#M206262</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,Thank you. The below mentioned solution worked as expected.&lt;/P&gt;&lt;P&gt;But we want to get the data display in a graph format. So I have amended the query as below:&lt;/P&gt;&lt;P&gt;index=abc host=xyz | rex "(?&amp;lt;seconds&amp;gt;\d+)s"&lt;BR /&gt;| rex "(?&amp;lt;milli&amp;gt;\d+)ms"&lt;BR /&gt;| rex "(?&amp;lt;micro&amp;gt;\d+)µs"&lt;BR /&gt;| rex "(?&amp;lt;nano&amp;gt;\d+)ns"&lt;BR /&gt;| fillnull value=0 seconds milli micro nano&lt;BR /&gt;| eval seconds=round(seconds+(((((nano/1000)+micro)/1000)+milli)/1000),9)&lt;/P&gt;&lt;P&gt;and then I have chosen Visualization--&amp;gt;Pivot--&amp;gt;Selected Fields.&lt;/P&gt;&lt;P&gt;Then i have chosen the Line Chart. And now I can see X Axis with Date and Y Axis with Seconds information.&lt;/P&gt;&lt;P&gt;So there are events with the same timing but with different seconds.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2022-03-23 00:51:53,113 Seconds 14.827107589&lt;BR /&gt;2022-03-23 00:51:53,113 Seconds 0.000293807&lt;BR /&gt;2022-03-23 00:51:53,113 Seconds 0.000333807&lt;BR /&gt;2022-03-23 00:51:53,113 Seconds 0.000436807&lt;BR /&gt;2022-03-23 00:51:53,113 Seconds 0.000781807&lt;/P&gt;&lt;P&gt;But in this graph, I can see the timing in X Axis whereas in Y axis for this timing&amp;nbsp;2022-03-23 00:51:53,113 i can see the count of Seconds ( i.e. Addition of all seconds and producing a count) for that time but we need the data in the graph for each and every events. So how to update the query so that for each and every event i need the graph output.&lt;/P&gt;&lt;P&gt;So kindly help&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 07:42:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592597#M206262</guid>
      <dc:creator>anandhalagaras1</dc:creator>
      <dc:date>2022-04-06T07:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592599#M206263</link>
      <description>&lt;P&gt;If you are trying to plot every event against the time it occurred then a scatter plot might be more appropriate. A line graph would be used for plotting one or more series of values (over time usually).&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 07:57:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592599#M206263</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-06T07:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592637#M206277</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for your response. But is there any possibility to bring the data for each event in Line&amp;nbsp; graph or Bar chart or Column Chart? And also for scatter chart how to mention the x axis and y axis information. Kindly help.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 09:44:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592637#M206277</guid>
      <dc:creator>anandhalagaras1</dc:creator>
      <dc:date>2022-04-06T09:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592641#M206280</link>
      <description>&lt;P&gt;What is it that you are trying to visualise with a line or bar chart?&lt;/P&gt;&lt;P&gt;For a scatter chart, looking at your data, I would imagine that the x-axis would be the time and the y-axis would be seconds&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 09:48:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592641#M206280</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-06T09:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592643#M206282</link>
      <description>&lt;UL&gt;&lt;LI&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; When I choose the Scatter chart there is a field as Mark so I have chosen the _time and Periods has been set to Auto and then for X axis what should I need to choose and for Y Axis should i need to choose the seconds? Since the data seems to be sluggish when i check now.&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 06 Apr 2022 10:16:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592643#M206282</guid>
      <dc:creator>anandhalagaras1</dc:creator>
      <dc:date>2022-04-06T10:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion During Search Runtime</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592651#M206285</link>
      <description>&lt;P&gt;It looks like _time might not work well with scatter charts&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":zipper_mouth_face:"&gt;🤐&lt;/span&gt; If the times are all from the same day, you could use mod 84600&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval time=_time%84600
| fields - _time&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Apr 2022 10:58:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-time-conversion-during-search-runtime/m-p/592651#M206285</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-06T10:58:27Z</dc:date>
    </item>
  </channel>
</rss>

