<commit_before>
===============================Prerequisites==============================
	
You need a Java Development Kit / JRE version 1.6.x or later and Apache Ant 1.7.0 or later, at a minimum, to try out the samples. Apache Ant can be downloaded from here: http://ant.apache.org. 

Please Follow below instructions to run the HTTPD Logs sample
===================================================================

1. Start the WSO2 DAS Server
2. Add below stream definition to DAS server as explained in https://docs.wso2.com/display/CEP310/Working+with+Event+Streams
{
                      'name':'org.wso2.sample.httpd.logs', 
                      'version':'1.0.0',
                      'nickName': 'Httpd_Log_Stream', 
                      'description': 'Sample of Httpd logs', 
                      'metaData':[ 
                              {'name':'clientType','type':'STRING'} 
                      ], 
                      'payloadData':[ 
                              {'name':'remoteIp','type':'STRING'},
                              {'name':'requestDate','type':'STRING'},
                              {'name':'request','type':'STRING'},
                              {'name':'httpcode','type':'STRING'},
                              {'name':'length','type':'STRING'}
                      ] 
}
3. Create a new Event Receiver configuration for the above stream. You can create it by logging to management console
and going to Main -> Event Processor -> Event Receivers and create an event receiver for wso2event type and org.wso2.sample.httpd.logs_1.0.0 stream.
Or you can copy the below xml content and paste it under DAS_HOME/repository/deployment/server/eventreceivers directory with file name 'logstream.xml'.

        <?xml version="1.0" encoding="UTF-8"?>
        <eventReceiver name="logstream" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
            <from eventAdapterType="wso2event"/>
            <mapping customMapping="disable" type="wso2event"/>
            <to streamName="org.wso2.sample.httpd.logs" version="1.0.0"/>
        </eventReceiver>

3. Go to $WSO2_DAS_HOME/samples/httpd-logs directory via console
4. Type 'ant' from the console
 (This will read the access.log from the $WSO2_DAS_HOME/samples/httpd-logs/resources Directory and send each log line as event )


<commit_msg>Updating the readme file.<commit_after>
===============================Prerequisites==============================
	
You need a Java Development Kit / JRE version 1.7.x or later and Apache Ant 1.7.0 or later, at a minimum, to try out the samples. Apache Ant can be downloaded from here: http://ant.apache.org.

Please Follow below instructions to run the HTTPD Logs sample
===================================================================

1. Add below entry to the DAS_HOME/repository/conf/spark/spark-udf-config.xml

<udf-configuration>
    <custom-udf-classes>
    .........
        <class-name>org.wso2.das.samples.geoip.IPCountryNameUDF</class-name>
        <class-name>org.wso2.das.samples.geoip.IPCountryCodeUDF</class-name>
    .........
     </custom-udf-classes>
 </udf-configuration>

2. Start the WSO2 DAS Server.
2. Go to Main -> Carbon Applications -> Add in DAS management console and upload the .car file located in DAS_HOME/samples/capps/Httpd_Log_Analytics.car
3. Go to $WSO2_DAS_HOME/samples/httpd-logs directory via console
4. Type 'ant' from the console
 (This will read the access.log from the $WSO2_DAS_HOME/samples/httpd-logs/resources Directory and send each log line as event )
5. You will see the spark script is executing in the beginning of every minute.
6.And after one successful execution of spark script, you can check the dashbord. Go to Main -> Dashboard -> Analytics Dashboard  and then login.
7. Go to Dashboards -> HTTPD Log Analysis Dashboard and click on view.



{'fraction_non_alphanumeric': 0.16559028674761045, 'fraction_numerical': 0.013949883750968742, 'mean_word_length': 2.8450844091360477, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 1, '>': 24, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3863664', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1021, 'n_words': 347}