<?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: What is the regex for the following output ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-regex-for-the-following-output/m-p/337226#M164394</link>
    <description>&lt;P&gt;@JyotiP, you can try the following regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;
| rex "\"FirmName\":\"(?&amp;lt;firmName&amp;gt;[^\"]+)\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, seems like you have JSON data, so it is better if you try rex to get complete JSON Data packet and then apply &lt;CODE&gt;spath&lt;/CODE&gt; command.&lt;BR /&gt;
You should also try out couple of &lt;CODE&gt;props.conf&lt;/CODE&gt; properties like &lt;CODE&gt;INDEXED_EXTRACTION=json&lt;/CODE&gt; and/or &lt;CODE&gt;KV_MODE=json&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2017 10:51:06 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-12-12T10:51:06Z</dc:date>
    <item>
      <title>What is the regex for the following output ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-regex-for-the-following-output/m-p/337224#M164392</link>
      <description>&lt;P&gt;Query :&lt;BR /&gt;
"POST" "200" "api/platform/v1/Session" FirmName&lt;/P&gt;

&lt;P&gt;Output:&lt;BR /&gt;
Level="INFO", Date="2017-12-12 04:06:26,200", Message="GET session API complete.", JobType="GetSession", TimeSpan="14ms", URL="&lt;A href="http://test:8080/v1/session"&gt;http://test:8080/v1/session&lt;/A&gt;", ActivityId="70a51b98-365f-4882-94c7-9563d465b211", Header="{"Authorization":"**&lt;STRONG&gt;&lt;EM&gt;","UserSession":{"FirmId":10017,"UserId":20,"FirmName":" Test2","UserName":"AutomationTests","UserSessionToken":"&lt;/EM&gt;&lt;/STRONG&gt;**","FirmAuthToken":"T4QV4","EnvironmentName":"AWSPROD"},"TransactionId":"7c257e48-3816-48bc-a717-fe96f5c33271","X-Request-Id":"70a51b98-365f-4882-94c7-9563d465b211","X-Operation":"{\"OperationId\":\"fa255617-2fae-44d7-9b16-8813f35d12a3\",\"OperationName\":\"Post to IBOR\"}","X-Trace":"0"}", OperationId="fa255617-2fae-44d7-9b16-8813f35d12a3", OperationName="Post to IBOR", Product="CoreData", Stack="core-data", Service="graphql", AppDomain="core-data_graphql"&lt;/P&gt;

&lt;P&gt;I just want to fetch the FirmName value then what would be the regext for it.Basically I want to fetch "Test2" in output. How would I do it ?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 10:21:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-regex-for-the-following-output/m-p/337224#M164392</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2017-12-12T10:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: What is the regex for the following output ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-regex-for-the-following-output/m-p/337225#M164393</link>
      <description>&lt;P&gt;hey @JyotiP&lt;/P&gt;

&lt;P&gt;Try this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=your_index | rex field=_raw "FirmName\"\:\"\s+(?P&amp;lt;FirmName&amp;gt;[^\"]+)"

OR 

 index=your_index | rex field=_raw "FirmName\"\:\"(?P&amp;lt;FirmName&amp;gt;[^\"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if it helps!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 10:48:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-regex-for-the-following-output/m-p/337225#M164393</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2017-12-12T10:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: What is the regex for the following output ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-regex-for-the-following-output/m-p/337226#M164394</link>
      <description>&lt;P&gt;@JyotiP, you can try the following regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;
| rex "\"FirmName\":\"(?&amp;lt;firmName&amp;gt;[^\"]+)\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, seems like you have JSON data, so it is better if you try rex to get complete JSON Data packet and then apply &lt;CODE&gt;spath&lt;/CODE&gt; command.&lt;BR /&gt;
You should also try out couple of &lt;CODE&gt;props.conf&lt;/CODE&gt; properties like &lt;CODE&gt;INDEXED_EXTRACTION=json&lt;/CODE&gt; and/or &lt;CODE&gt;KV_MODE=json&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 10:51:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-regex-for-the-following-output/m-p/337226#M164394</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-12T10:51:06Z</dc:date>
    </item>
  </channel>
</rss>

