Docker Centralized Logging With ELK Stack

As your infrastructure grows, it becomes crucial to have a reliable centralized logging system. Log centralization is becoming a key aspect of a variety of IT tasks and provides you with an overview of your entire system.

The best solution is to aggregate the logs from all containers, which is enriched with metadata so that it provides you with better traceability options and comes with awesome community support. This is where the ELK Stack comes into the picture. ELK, also known as the Elastic stack, is a combination of modern open-source tools like ElasticSearch, Logstash, and Kibana. It is a complete end-to-end log analysis solution you can use for your system.

Compressing Your Big Data: Tips and Tricks

The growth of big data has created a demand for ever-increasing processing power and efficient storage. DigitalGlobe’s databases, for example, expand by roughly 100TBs a day and cost an estimated $500K a month to store.

Compressing big data can help address these demands by reducing the amount of storage and bandwidth required for data sets. Compression can also remove irrelevant or redundant data, making analysis and processing easier and faster.

Java Streams Overview, Part II

In my previous article, I wrote about the fundamentals of streams in Java 8. Now, let's augment our skills with some additional information about streams, like how we can chain them, and we can use them to access files.

Chaining Streams

When working with streams, they are often chained together.

A program to list a code listing (beginner stuff

I just started learning C with a book called "Sams | Teach Yourself C in 21 Days, 6th edition" and I've already run into a problem I can't solve. The book gives a program that is supposed to display any code from any saved source file - including its own. As the book states on page 37, "The list_it.c program in Listing 2.2 displays C program listings that you have saved. These listings are displayed on the screen with line numbers added."

The problem is that I don't know how to use it to make it work and the book doesn't give any specific instructions for using it. What am I supposed to do with it? I'm using Dev C++ and when I run it all I get is this:

            Proper Usage is:

            list_it filename.ext

I've tried renaming and recompliling this program with two different filenames - list_it multiply.c and list_it list_it.c and it just gave me scrambled junk. I've also tried opening multiply.c and using the same approach and I got the same result.
Here's the code:

/* list_it.c - This program displays a listing with line numbers! */

#include <stdio.h>
#include <stdlib.h>

void display_usage(void);
int line;

int main( int argc, char *argv[] )
{
    char buffer[256];
    FILE *fp;

    if(argc < 2)
    {
        display_usage();
        return 1;
    }

    if (( fp = fopen( argv[1], "r" )) == NULL )
    {

        fprintf( stderr, "Error opening file, %s!", argv[1] );
        return(1);

    }

    line = 1;

    while( fgets( buffer, 256, fp ) != NULL )
        fprintf( stdout, "%4d:\t%s", line++, buffer );

    fclose(fp);
    return 0;

}   

void display_usage(void)
{
    fprintf(stderr, "\nProper Usage is: " );
    fprintf(stderr, "\n\nlist_it filename.ext\n" );
}

How to store data from file redirect to new file using C

Hi all,

I am working on a project that should take all the data from file redirect and write them to a new file. Here is what I have:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "node.h"
#include "tree.h"

#define TRUE 0
#define FALSE 1
#define stdin stdin
#define stdout stdout
#define stderr stderr

    int main(int argc,char *argv[])
    {
    int i;
    FILE *fp;

    fp = fopen("result.out", "w"); //create file to write stdin data to. 

    if(fp == NULL) // file validation
    {
    printf("Could not open file");
    return 0;
    }

     if(argc == 1) // executes if command line has file redirect. 
    {
    printf("Getting data from file redirect. \n");
    fprintf (fp, "%s\n", stdin); //Print arguments from redirect to fp.

    }
     printf("Completed\n");
    return 0;
    }

This code will execute fine with no errors, but result.out is empty
The file being redirected only contains words separated by spaces.
I also never know the size of the file being redirected.
I just want to copy the data from the file being redirected to result.out.

Any suggestions on how I can improve the code?