<?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: how to extract a timestamp from beginning of splunk log statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-a-timestamp-from-beginning-of-splunk-log/m-p/562377#M195587</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228867"&gt;@donB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share the original _raw event and highlight the timestamp required to be extracted?&lt;/P&gt;</description>
    <pubDate>Fri, 06 Aug 2021 07:32:41 GMT</pubDate>
    <dc:creator>venkatasri</dc:creator>
    <dc:date>2021-08-06T07:32:41Z</dc:date>
    <item>
      <title>how to extract a timestamp from beginning of splunk log statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-a-timestamp-from-beginning-of-splunk-log/m-p/562369#M195581</link>
      <description>&lt;P&gt;All my log statements are of below format.&lt;/P&gt;&lt;LI-CODE lang="java"&gt;{
	"source": "stdout",
	"tag": "practice/myapplication:4444a76b917",
	"labels": {
		"pod-template-hash": "343242344",
		"version": "9216a76b917b8258a1ee6de7d3bbf9a78ca59f1f",
		"app_docker_io/instance": "my-application"
	},
	"time": "1628235185.043",
	"line": "2021-08-06T07:33:05.043Z LCS traceId=a83a082592cf2275, spanId=a83a082592cf2275 LCE [qtp310090733-278] ERROR c.p.p.c.a.ErrorHandlerAdvice.logErrorDesc(34) - ERROR RESPONSE SENT",
	"attrs": {
		"image": "practice/myapplication:4444a76b917",
		"env": "dev",
		"region": "local",
		"az": "us-west"
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to extract the timestamp from beginning of each line and sort my results based on that timestamp. I have no idea of splunk search queries. can someone help?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 07:43:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-a-timestamp-from-beginning-of-splunk-log/m-p/562369#M195581</guid>
      <dc:creator>donB</dc:creator>
      <dc:date>2021-08-06T07:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract a timestamp from beginning of splunk log statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-a-timestamp-from-beginning-of-splunk-log/m-p/562377#M195587</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228867"&gt;@donB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share the original _raw event and highlight the timestamp required to be extracted?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 07:32:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-a-timestamp-from-beginning-of-splunk-log/m-p/562377#M195587</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-08-06T07:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract a timestamp from beginning of splunk log statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-a-timestamp-from-beginning-of-splunk-log/m-p/562381#M195588</link>
      <description>&lt;P&gt;added the raw event (json), thank you&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 07:43:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-a-timestamp-from-beginning-of-splunk-log/m-p/562381#M195588</guid>
      <dc:creator>donB</dc:creator>
      <dc:date>2021-08-06T07:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract a timestamp from beginning of splunk log statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-a-timestamp-from-beginning-of-splunk-log/m-p/562384#M195590</link>
      <description>&lt;P&gt;your _time should have been mapped to "time": already. you can check that by converting it from epoch to readable format.&lt;/P&gt;&lt;P&gt;Alternatively try this for your requirement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex "\"time\":\s+\"(?&amp;lt;time&amp;gt;[^\"]+)" 
| sort time
| convert ctime(time) as time_readable &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 08:02:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-a-timestamp-from-beginning-of-splunk-log/m-p/562384#M195590</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-08-06T08:02:44Z</dc:date>
    </item>
  </channel>
</rss>

