<?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: Extracting values from a event log search for key value pairs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-values-from-a-event-log-search-for-key-value-pairs/m-p/477989#M192797</link>
    <description>&lt;P&gt;Thanks @to4kawa  for a quick reply.  I was able to use for a single recurrence. &lt;/P&gt;

&lt;P&gt;I have a followup query as how to combine it with search command evaluate overall output for a specified time range. The raw data above is the output from the search command for a single occurence. &lt;/P&gt;

&lt;P&gt;The search command I have used is -&lt;/P&gt;

&lt;P&gt;call-abc-dp-nats runtime&lt;/P&gt;

&lt;P&gt;which emits the output for events for multiple rows in the format of raw data as per above.&lt;/P&gt;

&lt;P&gt;How to pipe the output from search command in 'eval'  to get results across all the rows (events) ?&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2020 03:08:03 GMT</pubDate>
    <dc:creator>mpd202004</dc:creator>
    <dc:date>2020-04-20T03:08:03Z</dc:date>
    <item>
      <title>Extracting values from a event log search for key value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-values-from-a-event-log-search-for-key-value-pairs/m-p/477987#M192795</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;

&lt;P&gt;I am  using search to get the values for ‘runtime’ and trying to get overall stats for a runtime values in the log for a given time period.&lt;/P&gt;

&lt;P&gt;For my search command, I get the output with multiple rows as per below ( single row) -&lt;/P&gt;

&lt;P&gt;&amp;nbsp;host:&amp;nbsp;abc-lyui-09&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;level:&amp;nbsp;info&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;msg:&amp;nbsp;{"key”:”#’abc.xyz.services.abc-def/call-qwe-rt-nats","return":"{\"status\":\"error\",\"errors\":[{\"code\":\"server-error\"}],\"timestamp\":\"2020-04-19T17:38:25.147Z\"}","time":600474579345999,"start-time":600473689740122,"state":"return","stop-time":600474579339135,"thread":48703,"runtime":889.599013,"correlation-id":"f0c7e1d1-db8d-4fb7-b564-e89c6fc625f3"}&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;timestamp:&amp;nbsp;2020-04-19 17:38:25.150+0000&lt;/P&gt;

&lt;P&gt;I am trying to extract values for ‘runtime’ ( example above with 889.599013) from the log for a  given time range to find the trend ( e.g. last 24 hrs). &lt;/P&gt;

&lt;P&gt;The example output can be for a selected time period.&lt;/P&gt;

&lt;P&gt;timestamp, runtime , correlation-id&lt;/P&gt;

&lt;P&gt;Whats the best way to get the output? I am novice to splunk search and reporting.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 00:55:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-values-from-a-event-log-search-for-key-value-pairs/m-p/477987#M192795</guid>
      <dc:creator>mpd202004</dc:creator>
      <dc:date>2020-04-20T00:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting values from a event log search for key value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-values-from-a-event-log-search-for-key-value-pairs/m-p/477988#M192796</link>
      <description>&lt;OL&gt;
&lt;LI&gt;use &lt;CODE&gt;rex&lt;/CODE&gt; . this command extracts the field. you can use &lt;A href="https://regex101.com"&gt;https://regex101.com&lt;/A&gt; to check REGEX.&lt;/LI&gt;
&lt;LI&gt;use &lt;CODE&gt;table&lt;/CODE&gt; . this command displays selected fields.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;reference:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Rex"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Rex&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Table"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Table&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="host: abc-lyui-09
   level: info
   msg: {\"key”:”#’abc.xyz.services.abc-def/call-qwe-rt-nats\",\"return\":\"{\\\"status\\\":\\\"error\\\",\\\"errors\\\":[{\\\"code\\\":\\\"server-error\\\"}],\\\"timestamp\\\":\\\"2020-04-19T17:38:25.147Z\\\"}\",\"time\":600474579345999,\"start-time\":600473689740122,\"state\":\"return\",\"stop-time\":600474579339135,\"thread\":48703,\"runtime\":889.599013,\"correlation-id\":\"f0c7e1d1-db8d-4fb7-b564-e89c6fc625f3\"}
   timestamp: 2020-04-19 17:38:25.150+0000" 
| rex max_match=3 "timestamp\W+(?&amp;lt;timestamp&amp;gt;[^\"]+Z)|runtime\W+(?&amp;lt;runtime&amp;gt;[\d.]+)|correlation-id\W+(?&amp;lt;correlation_id&amp;gt;[\w-]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Apr 2020 01:44:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-values-from-a-event-log-search-for-key-value-pairs/m-p/477988#M192796</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-20T01:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting values from a event log search for key value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-values-from-a-event-log-search-for-key-value-pairs/m-p/477989#M192797</link>
      <description>&lt;P&gt;Thanks @to4kawa  for a quick reply.  I was able to use for a single recurrence. &lt;/P&gt;

&lt;P&gt;I have a followup query as how to combine it with search command evaluate overall output for a specified time range. The raw data above is the output from the search command for a single occurence. &lt;/P&gt;

&lt;P&gt;The search command I have used is -&lt;/P&gt;

&lt;P&gt;call-abc-dp-nats runtime&lt;/P&gt;

&lt;P&gt;which emits the output for events for multiple rows in the format of raw data as per above.&lt;/P&gt;

&lt;P&gt;How to pipe the output from search command in 'eval'  to get results across all the rows (events) ?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 03:08:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-values-from-a-event-log-search-for-key-value-pairs/m-p/477989#M192797</guid>
      <dc:creator>mpd202004</dc:creator>
      <dc:date>2020-04-20T03:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting values from a event log search for key value pairs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-values-from-a-event-log-search-for-key-value-pairs/m-p/477990#M192798</link>
      <description>&lt;P&gt;see following:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunkbase/splunkbase/Answers/Questions#Details.2C_details.2C_details"&gt;https://docs.splunk.com/Documentation/Splunkbase/splunkbase/Answers/Questions#Details.2C_details.2C_details&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://www.splunk.com/en_us/training/courses/splunk-fundamentals-1.html"&gt;https://www.splunk.com/en_us/training/courses/splunk-fundamentals-1.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 07:02:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-values-from-a-event-log-search-for-key-value-pairs/m-p/477990#M192798</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-20T07:02:33Z</dc:date>
    </item>
  </channel>
</rss>

