<?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: Extract variable between pipe symbole from log and use it for query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524280#M147907</link>
    <description>&lt;P&gt;my bad , got it what you are saying.,&lt;/P&gt;&lt;P&gt;As second part of my question how can we user Var1 as variable for next search?&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2020 22:12:51 GMT</pubDate>
    <dc:creator>krishman23</dc:creator>
    <dc:date>2020-10-12T22:12:51Z</dc:date>
    <item>
      <title>Extract  variable between pipe symbol from log and use it for query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524273#M147903</link>
      <description>&lt;P&gt;I have a log generated in splunk which will have unique id&amp;nbsp; in with pipe symbols:&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;19:46:47.146 - [http-nio-8000-exec-9] INFO edu.test.controller |{My Var1}|{My Var2}|{myVar3}| - {log message}.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I need to perform a query based on &lt;SPAN class="t a"&gt;{My Var1}&lt;/SPAN&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also need to list (dedup) all logs best on &lt;SPAN class="t a"&gt;{My Var1}&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 21:08:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524273#M147903</guid>
      <dc:creator>krishman23</dc:creator>
      <dc:date>2020-10-12T21:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Extract variable between pipe symbole from log and use it for query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524275#M147904</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex "\|(?&amp;lt;Var1&amp;gt;[^\|]+)\|(?&amp;lt;Var2&amp;gt;[^\|]+)\|(?&amp;lt;Var3&amp;gt;[^\|]+)\|\s\-\s(?&amp;lt;logmessage&amp;gt;.*)"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 12 Oct 2020 21:08:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524275#M147904</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-12T21:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract variable between pipe symbole from log and use it for query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524277#M147905</link>
      <description>&lt;P&gt;but var1,var2,var3&amp;nbsp; are unknown to me, those are variables in log&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 21:28:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524277#M147905</guid>
      <dc:creator>krishman23</dc:creator>
      <dc:date>2020-10-12T21:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extract variable between pipe symbole from log and use it for query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524279#M147906</link>
      <description>&lt;P&gt;The rex extracts the value between the first two pipes into a field called Var1, the value between the second and third pipes into a field called Var2, etc. You can then use these fields in your query or just display them in as columns in a table. Is this not what you want to do?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 21:41:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524279#M147906</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-12T21:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract variable between pipe symbole from log and use it for query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524280#M147907</link>
      <description>&lt;P&gt;my bad , got it what you are saying.,&lt;/P&gt;&lt;P&gt;As second part of my question how can we user Var1 as variable for next search?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 22:12:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524280#M147907</guid>
      <dc:creator>krishman23</dc:creator>
      <dc:date>2020-10-12T22:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extract variable between pipe symbole from log and use it for query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524332#M147913</link>
      <description>&lt;P&gt;Depends on what you want to get out of your data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| dedup Var1
| where Var2="xyz"
| stats count by Var3&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 13 Oct 2020 07:02:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/524332#M147913</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-13T07:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract  variable between pipe symbol from log and use it for query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/526248#M148527</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;: i additional case in this rex, some time my logmessage will have URL as&amp;nbsp;&lt;/P&gt;&lt;P&gt;Req URL : hello/test/content&lt;/P&gt;&lt;P&gt;&amp;nbsp;or Req URL : hello/test/content/ , i need to truncate / of second request. Can you help with this ?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 15:14:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/526248#M148527</guid>
      <dc:creator>krishman23</dc:creator>
      <dc:date>2020-10-23T15:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extract  variable between pipe symbol from log and use it for query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/526252#M148528</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex field=events mode=sed "s/(?&amp;lt;url&amp;gt;[^\/]+\/[^\/]+\/[^\/]+)(?&amp;lt;slash&amp;gt;\/*)/\1/g"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 23 Oct 2020 15:35:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-between-pipe-symbol-from-log-and-use-it-for/m-p/526252#M148528</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-23T15:35:15Z</dc:date>
    </item>
  </channel>
</rss>

